The NetBSD Project

CVS log for src/sys/dev/ata/ata.c

[BACK] Up to [cvs.NetBSD.org] / src / sys / dev / ata

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.127 / (download) - annotate - [select for diffs], Wed Apr 3 17:15:07 2013 UTC (6 weeks, 3 days ago) by bouyer
Branch: MAIN
CVS Tags: khorben-n900, HEAD
Changes since 1.126: +16 -2 lines
Diff to previous 1.126 (colored)

Fix kernel dump on ahci controller, by making sure we won't sleep
while dumping:
- introduce ata_delay() which either use delay() or kpause()
  depending on flags. use it in sata_reset_interface() and
  some ahci functions
- kill ATA_NOSLEEP, it was tested but never set. use ATA_POLL instead.
- reduce delay while polling in ahci, to speed up the dump

Should fix PR kern/41095

Revision 1.126 / (download) - annotate - [select for diffs], Thu Nov 1 13:46:52 2012 UTC (6 months, 2 weeks ago) by abs
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, tls-maxphys-nbase, tls-maxphys-base, agc-symver-base, agc-symver
Changes since 1.125: +6 -3 lines
Diff to previous 1.125 (colored)

Allow setting ATADEBUG_MASK to default value of atadebug_mask

Revision 1.125 / (download) - annotate - [select for diffs], Sat Aug 4 21:21:09 2012 UTC (9 months, 1 week ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base6
Branch point for: tls-maxphys
Changes since 1.124: +3 -3 lines
Diff to previous 1.124 (colored)

If ch_ndrives is > 0, then ch_drive is not supposed to be NULL.

Revision 1.124 / (download) - annotate - [select for diffs], Tue Jul 31 15:50:34 2012 UTC (9 months, 2 weeks ago) by bouyer
Branch: MAIN
Changes since 1.123: +198 -85 lines
Diff to previous 1.123 (colored)

Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.

Revision 1.123 / (download) - annotate - [select for diffs], Sun Jul 29 21:10:50 2012 UTC (9 months, 2 weeks ago) by jakllsch
Branch: MAIN
Changes since 1.122: +19 -17 lines
Diff to previous 1.122 (colored)

Remove ata_channel->ata_drives, it's redundant with the pointer in
ata_drive_datas.  Originally part of a commit by bouyer@.

Revision 1.122 / (download) - annotate - [select for diffs], Thu Jul 26 20:49:47 2012 UTC (9 months, 3 weeks ago) by jakllsch
Branch: MAIN
Changes since 1.121: +69 -184 lines
Diff to previous 1.121 (colored)

Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@

Revision 1.121 / (download) - annotate - [select for diffs], Tue Jul 24 14:04:29 2012 UTC (9 months, 3 weeks ago) by jakllsch
Branch: MAIN
Changes since 1.120: +59 -59 lines
Diff to previous 1.120 (colored)

Revert dsl@'s changes of Sun, 15 Jul 2012 10:55:35 +0000 and
Sun, 15 Jul 2012 10:56:50 +0000, excepting the kernel version bump.
First step in reverting regressions to ata(4) subsystem during the addition of
port multiplier support.

Revision 1.120 / (download) - annotate - [select for diffs], Sun Jul 22 19:07:33 2012 UTC (9 months, 3 weeks ago) by jakllsch
Branch: MAIN
Changes since 1.119: +3 -3 lines
Diff to previous 1.119 (colored)

It turns out my previous commit here was off by one.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Jul 15 15:49:46 2012 UTC (10 months ago) by jakllsch
Branch: MAIN
Changes since 1.118: +7 -5 lines
Diff to previous 1.118 (colored)

Stopgap crash prevention when atadebug_mask includes DEBUG_PROBE bit.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Jul 15 10:55:29 2012 UTC (10 months ago) by dsl
Branch: MAIN
Changes since 1.117: +59 -59 lines
Diff to previous 1.117 (colored)

Some namespace protection (and add greppablity).
Prefix the DRIVE_ and DRIVET_ constants from atavar.h with ATA_.
Don't use an enum for drive_type - you don't know how big it will be.
Move driver_type to avoid implicit structure padding (esp on arm).
This change is purely lexical and mechanical.

Update to 6.99.9 - this wasn't done when the SATA PMP changes
were made - I'm sure they warranted a bump.

Revision 1.117 / (download) - annotate - [select for diffs], Mon Jul 2 18:15:46 2012 UTC (10 months, 2 weeks ago) by bouyer
Branch: MAIN
Changes since 1.116: +181 -68 lines
Diff to previous 1.116 (colored)

Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
  probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
  really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
  ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
  with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
  University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
  when SATA cable move was needed

Revision 1.116 / (download) - annotate - [select for diffs], Fri Apr 6 02:52:00 2012 UTC (13 months, 1 week ago) by isaki
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored)

Fix a typo (that I found 5 years ago).  Though the definition of
atabusiodetach_args is the same as atabusioscan_args (at the moment).

Revision 1.115 / (download) - annotate - [select for diffs], Sat Apr 30 00:34:03 2011 UTC (2 years ago) by jakllsch
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, rmind-uvmplock-nbase, rmind-uvmplock-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base8, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3, cherry-xenmp-base, cherry-xenmp
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.114: +44 -3 lines
Diff to previous 1.114 (colored)

Add simplistic atabus(4) rescan support.

Revision 1.114 / (download) - annotate - [select for diffs], Mon Apr 18 01:47:28 2011 UTC (2 years, 1 month ago) by rmind
Branch: MAIN
Changes since 1.113: +43 -36 lines
Diff to previous 1.113 (colored)

Replace few simple_lock and ltsleep/wakeup uses with mutex(9) and condvar(9).

Note to all: please replace old primitives in your code! Thanks.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Mar 28 20:46:18 2010 UTC (3 years, 1 month ago) by snj
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1, matt-mips64-premerge-20101231, jruoho-x86intr-base, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: jruoho-x86intr
Changes since 1.112: +3 -3 lines
Diff to previous 1.112 (colored)

Spell "enough" properly.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Feb 24 22:37:56 2010 UTC (3 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.111: +6 -6 lines
Diff to previous 1.111 (colored)

A pointer typedef entails trading too much flexibility to declare const
and non-const types, and the kernel uses both const and non-const
PMF qualifiers and device suspensors, so change the pmf_qual_t and
device_suspensor_t typedefs from "pointers to const" to non-pointer,
non-const types.

Revision 1.111 / (download) - annotate - [select for diffs], Thu Jan 21 02:53:51 2010 UTC (3 years, 3 months ago) by dyoung
Branch: MAIN
CVS Tags: uebayasi-xip-base
Branch point for: uebayasi-xip
Changes since 1.110: +9 -15 lines
Diff to previous 1.110 (colored)

Cosmetic: join some lines.  Get out early on errors, change

        switch (...) {
                ...
                error = ...;
                break;
        }
        return error;

to

        switch (...) {
                ...
                return ...;
        }

Revision 1.110 / (download) - annotate - [select for diffs], Fri Jan 8 19:48:11 2010 UTC (3 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.109: +6 -6 lines
Diff to previous 1.109 (colored)

Expand PMF_FN_* macros.

Revision 1.109 / (download) - annotate - [select for diffs], Thu Nov 12 19:20:08 2009 UTC (3 years, 6 months ago) by dyoung
Branch: MAIN
CVS Tags: matt-premerge-20091211
Changes since 1.108: +3 -63 lines
Diff to previous 1.108 (colored)

Remove superfluous activation hook.

Revision 1.108 / (download) - annotate - [select for diffs], Mon Oct 19 18:41:12 2009 UTC (3 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.107: +2 -7 lines
Diff to previous 1.107 (colored)

Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !

Revision 1.107 / (download) - annotate - [select for diffs], Sun Sep 13 18:45:10 2009 UTC (3 years, 8 months ago) by pooka
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8
Changes since 1.106: +16 -4 lines
Diff to previous 1.106 (colored)

Wipe out the last vestiges of POOL_INIT with one swift stroke.  In
most cases, use a proper constructor.  For proplib, give a local
equivalent of POOL_INIT for the kernel object implementation.  This
way the code structure can be preserved, and a local link set is
not hazardous anyway (unless proplib is split to several modules,
but that'll be the day).

tested by booting a kernel in qemu and compile-testing i386/ALL

Revision 1.106 / (download) - annotate - [select for diffs], Tue May 12 12:10:29 2009 UTC (4 years ago) by cegger
Branch: MAIN
CVS Tags: yamt-nfs-mp-base7, yamt-nfs-mp-base6, yamt-nfs-mp-base5, yamt-nfs-mp-base4, jymxensuspend-base, jym-xensuspend-base
Changes since 1.105: +3 -3 lines
Diff to previous 1.105 (colored)

struct cfdata * -> cfdata_t, no functional changes intended.

Revision 1.105 / (download) - annotate - [select for diffs], Tue Apr 7 18:01:20 2009 UTC (4 years, 1 month ago) by dyoung
Branch: MAIN
CVS Tags: yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base
Changes since 1.104: +3 -2 lines
Diff to previous 1.104 (colored)

Cosmetic: flag a potential problem in ata_channel_attach():
it initializes a callout that does not appear to be destroyed
anywhere. Every callout_init() should ordinarily be matched by a
callout_destroy().

Revision 1.104 / (download) - annotate - [select for diffs], Fri Apr 3 21:31:08 2009 UTC (4 years, 1 month ago) by dyoung
Branch: MAIN
Changes since 1.103: +22 -10 lines
Diff to previous 1.103 (colored)

Stop dereferencing a dangling device_t pointer and crashing: skip the
drives flagged DRIVE_ATAPI in atabus_activate(,DVACT_DEACTIVATE) just as
we skip them in atabus_detach() and in atabus_childdetched().

Make atabus_detach() parallel attachment more closely by calling
config_detach() on the child chp->ata_drives[i] instead of on
chp->ch_drive[i].drv_softc.  Assert that ata_drives[i] and
ch_drive[i].drv_softc are equal, and set them both to NULL in
atabus_childdetached().

Revision 1.103 / (download) - annotate - [select for diffs], Thu Apr 2 00:09:32 2009 UTC (4 years, 1 month ago) by dyoung
Branch: MAIN
Changes since 1.102: +4 -4 lines
Diff to previous 1.102 (colored)

During shutdown, detach devices in an orderly fashion.

Call the detach routine for every device in the device tree, starting
with the leaves and moving toward the root, expecting that each
(pseudo-)device driver will use the opportunity to gracefully commit
outstandings transactions to the underlying (pseudo-)device and to
relinquish control of the hardware to the system BIOS.

Detaching devices is not suitable for every shutdown: in an emergency,
or if the system state is inconsistent, we should resort to a fast,
simple shutdown that uses only the pmf(9) shutdown hooks and the
(deprecated) shutdownhooks.  For now, if the flag RB_NOSYNC is set in
boothowto, opt for the fast, simple shutdown.

Add a device flag, DVF_DETACH_SHUTDOWN, that indicates by its presence
that it is safe to detach a device during shutdown.  Introduce macros
CFATTACH_DECL3() and CFATTACH_DECL3_NEW() for creating autoconf
attachments with default device flags.  Add DVF_DETACH_SHUTDOWN
to configuration attachments for atabus(4), atw(4) at cardbus(4),
cardbus(4), cardslot(4), com(4) at isa(4), elanpar(4), elanpex(4),
elansc(4), gpio(4), npx(4) at isa(4), nsphyter(4), pci(4), pcib(4),
pcmcia(4), ppb(4), sip(4), wd(4), and wdc(4) at isa(4).

Add a device-detachment "reason" flag, DETACH_SHUTDOWN, that tells the
autoconf code and a device driver that the reason for detachment is
system shutdown.

Add a sysctl, kern.detachall, that tells the system to try to detach
every device at shutdown, regardless of any device's DVF_DETACH_SHUTDOWN
flag.  The default for kern.detachall is 0.  SET IT TO 1, PLEASE, TO
HELP TEST AND DEBUG DEVICE DETACHMENT AT SHUTDOWN.

This is a work in progress.  In future work, I aim to treat
pseudo-devices more thoroughly, and to gracefully tear down a stack of
(pseudo-)disk drivers and filesystems, including cgd(4), vnd(4), and
raid(4) instances at shutdown.

Also commit some changes that are not easily untangled from the rest:

(1) begin to simplify device_t locking: rename struct pmf_private to
device_lock, and incorporate device_lock into struct device.

(2) #include <sys/device.h> in sys/pmf.h in order to get some
definitions that it needs.  Stop unnecessarily #including <sys/device.h>
in sys/arch/x86/include/pic.h to keep the amd64, xen, and i386 releases
building.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Nov 16 19:31:21 2008 UTC (4 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: nick-hppapmap-base2, mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.101: +15 -3 lines
Diff to previous 1.101 (colored)

cpu_intr_p() doesn't account for software interrupts (e.g. callouts) so
we can't use it here. Rssurect ATACH_TH_RUN, backing out
src/sys/dev/ata/ata.c 1.101
src/sys/dev/ata/ata_wdc.c 1.90
src/sys/dev/ata/atavar.h 1.77
src/sys/dev/ic/wdc.c 1.255
src/sys/dev/scsipi/atapi_wdc.c 1.108
Should fix kern/39927 and kern/39725.

Revision 1.101 / (download) - annotate - [select for diffs], Thu Oct 2 21:05:17 2008 UTC (4 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.100: +4 -17 lines
Diff to previous 1.100 (colored)

Kill ATACH_TH_RUN and use cpu_intr_p() instead.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Oct 1 18:23:55 2008 UTC (4 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.99: +66 -23 lines
Diff to previous 1.99 (colored)

Use a separate thread to probe/attach atabus's childrens. Fixes a deadlock
where the interrupt routine wants to wake up the atabus thread to perform a
reset, while the thread is blocked in wd's attach function.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Jun 12 21:46:35 2008 UTC (4 years, 11 months ago) by cegger
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base
Branch point for: haad-dm
Changes since 1.98: +7 -7 lines
Diff to previous 1.98 (colored)

use device_lookup_private to get softc

Revision 1.98 / (download) - annotate - [select for diffs], Tue Mar 18 20:46:36 2008 UTC (5 years, 2 months ago) by cube
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-nfs-mp-base2, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, hpcarm-cleanup-nbase, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, wrstuden-revivesa, simonb-wapbl
Changes since 1.97: +27 -22 lines
Diff to previous 1.97 (colored)

Split device_t and softc for ATA devices, as well as wd(4).  Other
cosmetic changes where appropriate.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Feb 29 06:38:28 2008 UTC (5 years, 2 months ago) by dyoung
Branch: MAIN
Changes since 1.96: +6 -6 lines
Diff to previous 1.96 (colored)

Use PMF_FN_ARGS, PMF_FN_PROTO.

Revision 1.96 / (download) - annotate - [select for diffs], Thu Jan 10 07:48:22 2008 UTC (5 years, 4 months ago) by dyoung
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.95: +2 -13 lines
Diff to previous 1.95 (colored)

Oops, remove some debug statements that slipped in there.

Revision 1.95 / (download) - annotate - [select for diffs], Thu Jan 10 07:41:20 2008 UTC (5 years, 4 months ago) by dyoung
Branch: MAIN
Changes since 1.94: +82 -34 lines
Diff to previous 1.94 (colored)

Use device_t, device_xname(), device_private().  Add atabus_childdetached()
to clean up pointers to detached children.

Revision 1.94 / (download) - annotate - [select for diffs], Fri Jan 4 21:17:50 2008 UTC (5 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base
Changes since 1.93: +3 -3 lines
Diff to previous 1.93 (colored)

Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.

Revision 1.93 / (download) - annotate - [select for diffs], Thu Dec 20 20:12:01 2007 UTC (5 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.92: +24 -13 lines
Diff to previous 1.92 (colored)

Don't allocate DEV_BSIZE from the stack, use kmem instead.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Dec 9 20:27:54 2007 UTC (5 years, 5 months ago) by jmcneill
Branch: MAIN
CVS Tags: yamt-kmem-base3, yamt-kmem-base2, cube-autoconf-base, cube-autoconf
Branch point for: bouyer-xeni386
Changes since 1.91: +33 -34 lines
Diff to previous 1.91 (colored)

Merge jmcneill-pm branch.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Oct 19 11:59:36 2007 UTC (5 years, 7 months ago) by ad
Branch: MAIN
CVS Tags: yamt-kmem-base, vmlocking2-base2, vmlocking2-base1, vmlocking-nbase, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Branch point for: yamt-kmem, vmlocking2, mjf-devfs
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored)

machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h

Revision 1.90 / (download) - annotate - [select for diffs], Mon Jul 9 21:00:30 2007 UTC (5 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base, nick-csl-alignment-base5, nick-csl-alignment-base, nick-csl-alignment, mjf-ufs-trans-base, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6, jmcneill-pm, bouyer-xenamd64
Changes since 1.89: +9 -22 lines
Diff to previous 1.89 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.89 / (download) - annotate - [select for diffs], Sun Jul 1 09:47:19 2007 UTC (5 years, 10 months ago) by dsl
Branch: MAIN
Changes since 1.88: +36 -36 lines
Diff to previous 1.88 (colored)

Remove 'else' after 'return' for clarity

Revision 1.88 / (download) - annotate - [select for diffs], Sat Mar 17 06:41:36 2007 UTC (6 years, 2 months ago) by dyoung
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic
Changes since 1.87: +4 -6 lines
Diff to previous 1.87 (colored)

Let config(1) know that #define ATADEBUG goes in opt_ata.h.  In
dev/ic/wdc.c and in dev/ata/ata.c, #include "opt_ata.h", and make
both the files compile with or *without* ATADEBUG.  Do not compile
with ATADEBUG by default.

Revision 1.87 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:30 2007 UTC (6 years, 2 months ago) by ad
Branch: MAIN
Branch point for: reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.86: +4 -3 lines
Diff to previous 1.86 (colored)

Pass an ipl argument to pool_init/POOL_INIT to be used when initializing
the pool's lock.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Mar 4 06:01:44 2007 UTC (6 years, 2 months ago) by christos
Branch: MAIN
Branch point for: vmlocking
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:27 2007 UTC (6 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: post-newlock2-merge, ad-audiomp-base, ad-audiomp
Branch point for: yamt-idlelwp
Changes since 1.84: +21 -21 lines
Diff to previous 1.84 (colored)

Merge newlock2 to head.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Dec 25 18:36:05 2006 UTC (6 years, 4 months ago) by wiz
Branch: MAIN
CVS Tags: newlock2-nbase, newlock2-base
Changes since 1.83: +3 -3 lines
Diff to previous 1.83 (colored)

Spell "schedule" correctly. From Zafer Aydogan.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Nov 16 01:32:47 2006 UTC (6 years, 6 months ago) by christos
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3, wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-nb4-arm-base, matt-nb4-arm
Changes since 1.82: +9 -9 lines
Diff to previous 1.82 (colored)

__unused removal on arguments; approved by core.

Revision 1.82 / (download) - annotate - [select for diffs], Wed Oct 25 17:33:02 2006 UTC (6 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.81: +3 -2 lines
Diff to previous 1.81 (colored)

Add sata registers to struct wdc_regs. Add wdc_sataprobe(), a function
probing drives using the standard SATA registers; taken from various
PCI sata drivers. Export wdc_drvprobe() too.

Revision 1.81 / (download) - annotate - [select for diffs], Sun Oct 15 00:00:00 2006 UTC (6 years, 7 months ago) by itohy
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.80: +43 -43 lines
Diff to previous 1.80 (colored)

white space police

Revision 1.80 / (download) - annotate - [select for diffs], Sat Oct 14 23:54:14 2006 UTC (6 years, 7 months ago) by itohy
Branch: MAIN
Changes since 1.79: +29 -21 lines
Diff to previous 1.79 (colored)

Add ATAPI Pioneer (info from Linux) and ATA TDK (I have one)
as exceptions of string byte order.
Add string byte order shuffling for big-endian platforms.

Revision 1.79 / (download) - annotate - [select for diffs], Thu Oct 12 01:30:55 2006 UTC (6 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.78: +10 -7 lines
Diff to previous 1.78 (colored)

- sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386

Revision 1.78 / (download) - annotate - [select for diffs], Sat Sep 30 15:56:18 2006 UTC (6 years, 7 months ago) by itohy
Branch: MAIN
Changes since 1.77: +34 -4 lines
Diff to previous 1.77 (colored)

A little effort against kernel bloat....
Exclude ATA DMA support if no ATA DMA capable drivers are compiled in.

Revision 1.77 / (download) - annotate - [select for diffs], Sun Sep 24 03:53:08 2006 UTC (6 years, 7 months ago) by jmcneill
Branch: MAIN
Changes since 1.76: +4 -3 lines
Diff to previous 1.76 (colored)

Add "name" parameter to powerhook_establish, to aid debugging. No objections
on tech-kern@

Revision 1.76 / (download) - annotate - [select for diffs], Thu Sep 7 12:34:42 2006 UTC (6 years, 8 months ago) by itohy
Branch: MAIN
CVS Tags: yamt-splraiseipl-base, yamt-pdpolicy-base9, rpaulo-netinet-merge-pcb-base
Branch point for: yamt-splraiseipl, newlock2
Changes since 1.75: +21 -3 lines
Diff to previous 1.75 (colored)

Add PIOBM (busmastering transfer using ATA PIO mode) support.
The PIOBM is used by only one driver (will be added later,
stay tuned) and intruduce an attribute "ata_piobm" so that
it will be conditionally compiled in.
The "ata_dma" (busmastering transfer using ATA DMA mode) and
"ata_udma" (busmastering transfer using ATA Ultra DMA mode)
attributes are also added for consistency, but unused for now.

Revision 1.75 / (download) - annotate - [select for diffs], Sun Aug 27 23:50:53 2006 UTC (6 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pdpolicy-base8
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored)

Add missing initializer

Revision 1.74 / (download) - annotate - [select for diffs], Wed Mar 29 04:16:48 2006 UTC (7 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, yamt-pdpolicy-base6, yamt-pdpolicy-base5, yamt-pdpolicy-base4, yamt-pdpolicy-base3, simonb-timecounters-base, gdamore-uart-base, gdamore-uart, elad-kernelauth-base, chap-midi-nbase, chap-midi-base, chap-midi, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored)

Use device_cfdata().

Revision 1.73 / (download) - annotate - [select for diffs], Sun Jan 22 16:40:56 2006 UTC (7 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5, yamt-pdpolicy-base2, yamt-pdpolicy-base, peter-altq-base
Branch point for: yamt-pdpolicy, simonb-timecounters, rpaulo-netinet-merge-pcb, peter-altq, elad-kernelauth
Changes since 1.72: +4 -4 lines
Diff to previous 1.72 (colored)

For an IDENTIFY we have to wait for DRQ after issuing the command.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Dec 11 12:21:14 2005 UTC (7 years, 5 months ago) by christos
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.71: +5 -5 lines
Diff to previous 1.71 (colored)

merge ktrace-lwp.

Revision 1.71 / (download) - annotate - [select for diffs], Thu Jul 7 17:51:31 2005 UTC (7 years, 10 months ago) by drochner
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-pervnode, yamt-readahead-perfile, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, yamt-readahead, thorpej-vnode-attr-base, thorpej-vnode-attr, ktrace-lwp-base
Changes since 1.70: +6 -5 lines
Diff to previous 1.70 (colored)

tighten the autoconf constraints by passing the atapi/ata/ata_hl attribute
to config_found()
(after some cleanup we might be able to kill SCSIPI_BUSTYPE_*)

Revision 1.70 / (download) - annotate - [select for diffs], Sun May 29 22:11:28 2005 UTC (7 years, 11 months ago) by christos
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.69: +5 -5 lines
Diff to previous 1.69 (colored)

- remove casts [to avoid volatile]
- sprinkle const
- avoid shadowed variables

Revision 1.69 / (download) - annotate - [select for diffs], Fri May 20 14:39:04 2005 UTC (8 years ago) by bouyer
Branch: MAIN
Changes since 1.68: +4 -5 lines
Diff to previous 1.68 (colored)

Close a window where (disks) interrupts could be enabled while the
ATACH_TH_RUN flag is still set. Should fix panic reported by Jukka Salmi
on netbsd-users@.

Revision 1.68 / (download) - annotate - [select for diffs], Mon May 16 21:43:33 2005 UTC (8 years ago) by bouyer
Branch: MAIN
Changes since 1.67: +34 -18 lines
Diff to previous 1.67 (colored)

Add a ata_queue_idle() function, which freeze a queue and tsleep() until the
controller is idle.
Change the powerhook function to call ata_queue_idle() on standby/suspend,
and ata_reset_channel() on resume (to wake up the disks and start from a
clean state).
Fix PR kern/30194 by Lubomir Sedlacik.

Revision 1.67 / (download) - annotate - [select for diffs], Mon Apr 11 04:24:54 2005 UTC (8 years, 1 month ago) by matt
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.66: +5 -5 lines
Diff to previous 1.66 (colored)

Fix mode printing. (don't panic on unmatched devices)

Revision 1.66 / (download) - annotate - [select for diffs], Fri Mar 4 11:00:54 2005 UTC (8 years, 2 months ago) by tacha
Branch: MAIN
CVS Tags: yamt-km-base4, yamt-km-base3, netbsd-3-base
Branch point for: netbsd-3
Changes since 1.65: +6 -2 lines
Diff to previous 1.65 (colored)

Disestablish powerhook while detaching atabus.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Feb 27 00:26:58 2005 UTC (8 years, 2 months ago) by perry
Branch: MAIN
Changes since 1.64: +22 -22 lines
Diff to previous 1.64 (colored)

nuke trailing whitespace

Revision 1.64 / (download) - annotate - [select for diffs], Wed Jan 26 21:51:40 2005 UTC (8 years, 3 months ago) by jmcneill
Branch: MAIN
CVS Tags: yamt-km-base2, matt-timespec
Changes since 1.63: +45 -3 lines
Diff to previous 1.63 (colored)

Add powerhook for atabus.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Nov 14 15:25:11 2004 UTC (8 years, 6 months ago) by soren
Branch: MAIN
CVS Tags: yamt-km-base, kent-audio1-beforemerge, kent-audio1-base, kent-audio1
Branch point for: yamt-km, kent-audio2
Changes since 1.62: +3 -3 lines
Diff to previous 1.62 (colored)

s/using DMA data transfers/using DMA/ to make it fit in 80 columns.
DMA only applies to data transfers anyway..

Revision 1.62 / (download) - annotate - [select for diffs], Sat Oct 30 23:10:37 2004 UTC (8 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.61: +36 -2 lines
Diff to previous 1.61 (colored)

Allow polled commands to be queued, if ata_exec_xfer() is called in thread
context. For this introduce 3 new xfer tags:
- C_WAIT, equivalent of AT_WAIT
- C_WAITACT, when there is a thread waiting on this xfer to become the active
  one (that is, to be at the head of the queue)
- C_FREE, set by ata_free_xfer() when it can't free the xfer because it's
  still in use. The holder should then free the xfer ASAP.

If ata_exec_xfer() is called with (C_POLL | C_WAIT), and there is already
xfers to be processed, assert C_WAITACT and sleep.
atastart() checks for C_WAITACT, and wakeup the thread waiting for this xfer
to become active if set. atastart() won't process this xfer, it's the
responsability of the thread waked up to handle it.

Fix (the right way) kern/27421 by Martin Husemann.

Revision 1.61 / (download) - annotate - [select for diffs], Thu Oct 28 20:11:41 2004 UTC (8 years, 6 months ago) by bouyer
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

Call xfer->c_start() with the channel from the xfer, not the one from the
thread. They may be different if we have a shared queue.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Sep 11 18:01:58 2004 UTC (8 years, 8 months ago) by bouyer
Branch: MAIN
Changes since 1.59: +3 -2 lines
Diff to previous 1.59 (colored)

If we're not going to handle a reset request because one if already pending,
decrease queue_freeze that we just increased (otherwise the queue stay
frozen after the reset).
Should fix kern/26873 and port-i386/26910.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Aug 21 00:48:32 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +5 -5 lines
Diff to previous 1.58 (colored)

Eliminate some gratuitous spl frobbing in atabus_thread().

Revision 1.58 / (download) - annotate - [select for diffs], Sat Aug 21 00:28:34 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.57: +30 -5 lines
Diff to previous 1.57 (colored)

atastart() (called only at splbio(), and from interrupts) can change
drive_flags, to make sure all drive_flags manipulations are done at
splbio().

Revision 1.57 / (download) - annotate - [select for diffs], Fri Aug 20 23:50:13 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.56: +27 -5 lines
Diff to previous 1.56 (colored)

- atabus_detach(): Manipulate ch_flags at splbio().
- ata_reset_channel(): Assert that we're at splbio() when called.
- Sprinkle some comments about functions that must be called at splbio().

Revision 1.56 / (download) - annotate - [select for diffs], Fri Aug 20 23:36:52 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.55: +4 -4 lines
Diff to previous 1.55 (colored)

WDC_DIAGNOSTIC -> ATA_DEBUG

Revision 1.55 / (download) - annotate - [select for diffs], Fri Aug 20 23:26:53 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.54: +51 -7 lines
Diff to previous 1.54 (colored)

- Add an (*ata_reset_channel)() member to ata_bustype.
- Add an ata_reset_channel() function that performs the common parts
  of resetting an ATA channel, which uses the (*ata_reset_channel)()
  callback to do the heavy lifting.  Adjust callers to use ata_reset_channel()
  instead of wdc_reset_channel().

This removes the last wdc-specific code from ata.c!

Revision 1.54 / (download) - annotate - [select for diffs], Fri Aug 20 22:26:23 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.53: +6 -16 lines
Diff to previous 1.53 (colored)

Use ANSI function decls for atabus open/close/ioctl.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Aug 20 22:19:00 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.52: +2 -3 lines
Diff to previous 1.52 (colored)

wdcreg.h is not needed here any more.

Revision 1.52 / (download) - annotate - [select for diffs], Fri Aug 20 22:17:06 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.51: +23 -2 lines
Diff to previous 1.51 (colored)

Move common parts of attaching an ata_channel to a new ata_channel_attach()
function.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Aug 20 22:02:40 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.50: +142 -2 lines
Diff to previous 1.50 (colored)

Move atabusconfig() to ata.c.

Revision 1.50 / (download) - annotate - [select for diffs], Fri Aug 20 20:53:20 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.49: +10 -4 lines
Diff to previous 1.49 (colored)

In ata_get_params(), use the (*ata_exec_command)() available from the
ata_bustype rather than using wdc_exec_command() directly.

Revision 1.49 / (download) - annotate - [select for diffs], Fri Aug 20 06:39:38 2004 UTC (8 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.48: +40 -39 lines
Diff to previous 1.48 (colored)

Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Aug 14 15:08:04 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.47: +40 -31 lines
Diff to previous 1.47 (colored)

- Split the register handles out of struct wdc_channel into a separate
  wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.

Revision 1.47 / (download) - annotate - [select for diffs], Fri Aug 13 04:10:49 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.46: +27 -27 lines
Diff to previous 1.46 (colored)

WDCDEBUG -> ATADEBUG.

Revision 1.46 / (download) - annotate - [select for diffs], Fri Aug 13 03:12:59 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.45: +11 -12 lines
Diff to previous 1.45 (colored)

Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Aug 13 02:16:40 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.44: +63 -4 lines
Diff to previous 1.44 (colored)

Move wdcstart() to ata.c and rename it to atastart().

Revision 1.44 / (download) - annotate - [select for diffs], Fri Aug 13 02:10:43 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.43: +23 -2 lines
Diff to previous 1.43 (colored)

Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer().

Revision 1.43 / (download) - annotate - [select for diffs], Thu Aug 12 22:39:40 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.42: +37 -5 lines
Diff to previous 1.42 (colored)

Move wdc_addref() and wdc_delref() to ata.c and rename them to
ata_*.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Aug 12 22:33:46 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.41: +36 -2 lines
Diff to previous 1.41 (colored)

Move wdc_kill_pending() to ata.c and rename it ata_kill_pending().

Revision 1.41 / (download) - annotate - [select for diffs], Thu Aug 12 21:34:52 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.40: +34 -2 lines
Diff to previous 1.40 (colored)

- Move wdc_xfer_pool, wdc_get_xfer(), wdc_free_xfer() to ata.c, and rename
  to ata_*.
- Use a static initializer for the ata_xfer_pool.

Revision 1.40 / (download) - annotate - [select for diffs], Thu Aug 12 21:10:18 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.39: +228 -2 lines
Diff to previous 1.39 (colored)

Move wdc_probe_caps() to ata.c and rename it ata_probe_caps().

Revision 1.39 / (download) - annotate - [select for diffs], Thu Aug 12 21:05:09 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.38: +52 -3 lines
Diff to previous 1.38 (colored)

Move wdc_downgrade_mode() to ata.c and rename it to ata_downgrade_mode().

Revision 1.38 / (download) - annotate - [select for diffs], Thu Aug 12 20:59:27 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.37: +36 -2 lines
Diff to previous 1.37 (colored)

Move wdc_print_modes() into ata.c and rename it ata_print_modes().

Revision 1.37 / (download) - annotate - [select for diffs], Thu Aug 12 05:02:50 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored)

Rename some constants:
WDC_COMPLETE -> ATACMD_COMPLETE
WDC_QUEUED -> ATACMD_QUEUED
WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN

Revision 1.36 / (download) - annotate - [select for diffs], Thu Aug 12 04:57:19 2004 UTC (8 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.35: +31 -31 lines
Diff to previous 1.35 (colored)

Rename "struct wdc_command" to "struct ata_command".

Revision 1.35 / (download) - annotate - [select for diffs], Tue Aug 10 23:09:38 2004 UTC (8 years, 9 months ago) by mycroft
Branch: MAIN
Changes since 1.34: +5 -2 lines
Diff to previous 1.34 (colored)

Hold a reference between atabus_attach() and atabusconfig() to avoid an extra
enable/disable cycle.  Now my CF card attaches a bit faster.

XXX This code is split strangely between files.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Aug 4 22:44:04 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Change wdc_kill_pending() to take a struct ata_drive_datas * as argument,
and kill only pending requests for this drive.
Implement a DRIVE_WAITDRAIN flag, which will cause the active command to
be killed once complete.
Other minor fixes.
Now it's possible to detach a ATA or ATAPI device from ioctl even when
a dd on the raw char partition is running.

Revision 1.33 / (download) - annotate - [select for diffs], Wed Aug 4 18:24:10 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.32: +5 -5 lines
Diff to previous 1.32 (colored)

Add
struct ata_xfer *active_xfer
to ata_queue. Now the active xfer isn't the head of the queue any more,
this makes a few things easier (this will also help for tagged queuing
support).
Remove the WDCF_ACTIVE flag, test active_xfer != NULL instead.
clean up wdc_free_xfer() and kill_xfer().
Clean up wdc_reset_channel(), and make it issue a ATAPI_SOFT_RESET if the
active command is ATAPI.
In wdc_atapi_get_params(), use AT_WAIT | AT_POLL for ATAPI_SOFT_RESET,
so that we'll use tsleep() instead of delay().
In wdc_atapi_start(), call wdc_dmawait() at the right place.

Revision 1.32 / (download) - annotate - [select for diffs], Tue Aug 3 22:37:19 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.31: +45 -2 lines
Diff to previous 1.31 (colored)

First cut at implementing ATABUSIODETACH. Still buggy.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Aug 2 22:02:35 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.30: +7 -9 lines
Diff to previous 1.30 (colored)

Clean up interraction between wdc_reset_channel and the kernel thread.
Move kill_xfer() after the reset, and stop the DMA engine if needed
(this will unload the DMA maps).

Revision 1.30 / (download) - annotate - [select for diffs], Sun Aug 1 21:40:41 2004 UTC (8 years, 9 months ago) by bouyer
Branch: MAIN
Changes since 1.29: +95 -2 lines
Diff to previous 1.29 (colored)

Implement an atabus control device, and define some ATA bus control
IOCTLS. Implement ATABUSIORESET, which will reset the given ATA bus.

Revision 1.29 / (download) - annotate - [select for diffs], Thu May 27 02:23:12 2004 UTC (8 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored)

Clean-up of use of "precomp".  It is used as "features" everywhere, so
rename the fields in wdc_command as appropriate.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Apr 13 19:51:06 2004 UTC (9 years, 1 month ago) by bouyer
Branch: MAIN
Changes since 1.27: +4 -4 lines
Diff to previous 1.27 (colored)

Make wdc_channel->ch_flags volatile, and cast it to (void *) when used
in tsleep()/wakeup() to appease gcc. Otherwise, the ch_flags value may
be cached in a register in atabus_thread(), and when it sets the WDCF_TH_RUN
bit after tsleep() it may loose loose the changes made by an interrupt handler
or another thread.
Problem analysed by Jukka Andberg on tech-kern.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jan 3 23:59:58 2004 UTC (9 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-2-0-base
Branch point for: netbsd-2-0
Changes since 1.26: +7 -7 lines
Diff to previous 1.26 (colored)

More structure member namespace cleanup: thread -> ch_thread

Revision 1.26 / (download) - annotate - [select for diffs], Sat Jan 3 22:56:53 2004 UTC (9 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +4 -4 lines
Diff to previous 1.25 (colored)

More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc

Revision 1.25 / (download) - annotate - [select for diffs], Sat Jan 3 01:50:53 2004 UTC (9 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.24: +9 -9 lines
Diff to previous 1.24 (colored)

Rename "struct channel_softc" to "struct wdc_channel".

Revision 1.24 / (download) - annotate - [select for diffs], Thu Jan 1 17:18:54 2004 UTC (9 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.23: +4 -4 lines
Diff to previous 1.23 (colored)

Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers.  Clean up the member names of these structures while at it.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Dec 30 16:28:37 2003 UTC (9 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.22: +296 -5 lines
Diff to previous 1.22 (colored)

Move most of the atabus layer into ata.c.

Revision 1.22 / (download) - annotate - [select for diffs], Tue Dec 30 00:43:31 2003 UTC (9 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.21: +7 -7 lines
Diff to previous 1.21 (colored)

Tweak function names in debug messages.

Revision 1.21 / (download) - annotate - [select for diffs], Sun Dec 14 02:45:48 2003 UTC (9 years, 5 months ago) by thorpej
Branch: MAIN
Changes since 1.20: +7 -12 lines
Diff to previous 1.20 (colored)

De-__P and use ANSI-style function decls.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Oct 8 10:58:12 2003 UTC (9 years, 7 months ago) by bouyer
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored)

Make the ATA mid-layer appears as atabus, as proposed in
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.

Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Sep 23 09:19:22 2003 UTC (9 years, 7 months ago) by mycroft
Branch: MAIN
Changes since 1.18: +5 -5 lines
Diff to previous 1.18 (colored)

Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Jan 27 21:27:52 2003 UTC (10 years, 3 months ago) by bouyer
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

Bump WDCC_IDENTIFY timeout to 3 seconds, as required by some drives.
Reported by Karl Janmar <karlj@mdstud.chalmers.se> on tech-kern.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Apr 9 21:17:53 2002 UTC (11 years, 1 month ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, nathanw_sa_before_merge, nathanw_sa_base, kqueue-beforemerge, kqueue-base, kqueue-aftermerge, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, gehenna-devsw-base, gehenna-devsw, fvdl_fs64_base
Branch point for: netbsd-1-6
Changes since 1.16: +5 -2 lines
Diff to previous 1.16 (colored)

In wdc_exec_command(), for data commands, read the status register after
the data transfer. This is mandatory for data out commands (although none are
used for now), and not forbiddend for data in commands. Also record if we
did transfers any data.
May solve kern/16159 by making the probe more robust in face of fake identify.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Dec 3 00:20:22 2001 UTC (11 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: newlock-base, newlock, ifpoll-base, ifpoll, eeh-devprop-base, eeh-devprop
Changes since 1.15: +3 -3 lines
Diff to previous 1.15 (colored)

Update my copyrigth.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Dec 3 00:11:15 2001 UTC (11 years, 5 months ago) by bouyer
Branch: MAIN
Changes since 1.14: +7 -38 lines
Diff to previous 1.14 (colored)

Allow wd to attach to something else than wdc/pciide (like USB<->ATA bridges):
- move some functions from ata.c to ata_wdc.c or wdc.c.
- add callbacks to struct ata_bustype so that wd.c doesn't call directly
  functions from the lower level driver.

Revision 1.14 / (download) - annotate - [select for diffs], Tue Nov 13 12:53:09 2001 UTC (11 years, 6 months ago) by lukem
Branch: MAIN
Changes since 1.13: +4 -1 lines
Diff to previous 1.13 (colored)

add RCSID

Revision 1.13 / (download) - annotate - [select for diffs], Mon May 15 08:31:33 2000 UTC (13 years ago) by bouyer
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base, thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2, thorpej-devvp-base, thorpej-devvp, pre-chs-ubcperf, post-chs-ubcperf, netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, minoura-xpg4dl-base, minoura-xpg4dl
Branch point for: netbsd-1-5, nathanw_sa, kqueue
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

- sync my copyrigth
- Add usefull message for obsolete error code (part of fix for kern/9856).

Revision 1.12 / (download) - annotate - [select for diffs], Tue Jan 25 09:33:12 2000 UTC (13 years, 3 months ago) by enami
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Don't put leading space, otherwise diskerr() prints unnecessary space
like this:
wd0h:  aborted command reading fsbn 650256 of 650256-650271 (wd0 bn 839056; cn 888 tn 13 sn 17), retrying

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jan 17 00:01:00 2000 UTC (13 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.10: +25 -1 lines
Diff to previous 1.10 (colored)

Improve the downgrade logic:
- If UDMA 2 is failing try UDMA 1 first, it helps in some cases
- downgrade if we get an error in the first 4000 xfers, or if we get
  4 errors in 4000 xfers if the first 4000 went without troubles.

While I'm there commit a local change I have since some time to get my CD
probed: issue a "blanck" IDENTIFY before the one used to detect slave ghosts,
with my drive the first IDENTIFY following a controller reset fails with an
aborted command ...

Revision 1.10 / (download) - annotate - [select for diffs], Fri Nov 26 12:39:43 1999 UTC (13 years, 5 months ago) by bouyer
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221
Changes since 1.9: +9 -2 lines
Diff to previous 1.9 (colored)

More WDCDEBUG_PRINT.

Revision 1.9 / (download) - annotate - [select for diffs], Thu Apr 15 09:41:09 1999 UTC (14 years, 1 month ago) by bouyer
Branch: MAIN
CVS Tags: fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-base
Branch point for: wrstuden-devbsize, thorpej_scsipi
Changes since 1.8: +3 -2 lines
Diff to previous 1.8 (colored)

Bump timeout to 10s only for ATAPI devices, 1s is fine for IDE drives once
they are ready.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Apr 14 22:23:15 1999 UTC (14 years, 1 month ago) by jonathan
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

Complete bugfix in rev 1.3: increase read-parameter-block timeout to 10s
  (as used for the hardware for which rev 1.3 was made.)

Revision 1.7 / (download) - annotate - [select for diffs], Wed Mar 10 13:11:43 1999 UTC (14 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Changes since 1.6: +4 -2 lines
Diff to previous 1.6 (colored)

Add a new disk flag: DRIVE_OLD for pre-ATA disks. probe routine will now set
DRIVE_OLD, DRIVE_ATA or DRIVE_ATAPI based on register signatures.
The attach routine will issue a IDENTIFY command for ATA/ATAPI disk,
to detect flase matches by the probe routine.
probe/attach should now be fully compliant with ata-4/ata-5. As a side
effect, ATAPI drives which improperly use ATA register signatures should now
be attached as ATAPI.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 21 00:52:04 1999 UTC (14 years, 2 months ago) by hubertf
Branch: MAIN
Changes since 1.5: +3 -1 lines
Diff to previous 1.5 (colored)

Only define WDCDEBUG if not already define (e.g. by kernel option)

Revision 1.5 / (download) - annotate - [select for diffs], Mon Feb 8 15:22:28 1999 UTC (14 years, 3 months ago) by bouyer
Branch: MAIN
CVS Tags: bouyer-ide-last-dist
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (colored)

There's no ATA draft where it is required for the drive to set DRDY | DSC when
the disk is ready to transfer data, and in ATA-5 the DSC has been obsoleted.
So only wait for DRQ to transfer data. This can be made conditional on the
ATA version if it's proven to break with some drives (worked with all the
drives I have access to).
While I'm there correct a few typos.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Jan 18 20:06:24 1999 UTC (14 years, 4 months ago) by bouyer
Branch: MAIN
Changes since 1.3: +36 -1 lines
Diff to previous 1.3 (colored)

move wd.c:print_wderror() to ata.c:ata_perror().
In wdc_probe_caps() add code to guess the ATA revision supported (if
ATA4 if Ultra-DMA, ATA2 if PIO mode > 2). We can't rely on param.atap_ata_major
here, at last one Ultra-DMA drive claims to support only ATA-3.
Use the ATA version in ata_perror(), and to try a flush cache command
in a shutdown hook for IDE drives.

Revision 1.3 / (download) - annotate - [select for diffs], Mon Nov 16 11:25:41 1998 UTC (14 years, 6 months ago) by bouyer
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

For ATAPI IDENTiFY, poll only for DRQ, some devices don't assert DRDY at this
point.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Oct 12 16:09:14 1998 UTC (14 years, 7 months ago) by bouyer
Branch: MAIN
CVS Tags: chs-ubc-base, chs-ubc
Changes since 1.1: +151 -0 lines
Diff to previous 1.1 (colored)

Merge bouyer-ide

Revision 1.1, Thu Jun 4 16:52:33 1998 UTC (14 years, 11 months ago) by bouyer
Branch: MAIN
CVS Tags: bouyer-ide-base
Branch point for: bouyer-ide
FILE REMOVED

file ata.c was initially added on branch bouyer-ide.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>