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


Revision 1.149.2.3 / (download) - annotate - [select for diffs], Fri Dec 30 14:39:10 2022 UTC (5 weeks, 2 days ago) by martin
Branch: netbsd-9
Changes since 1.149.2.2: +11 -16 lines
Diff to previous 1.149.2.2 (colored) to branchpoint 1.149 (colored) next main 1.150 (colored)

Pull up following revision(s) (requested by tsutsui in ticket #1557):

	sys/dev/ic/ahcisata_core.c: revision 1.83
	sys/dev/ic/ahcisata_core.c: revision 1.102
	sys/dev/ata/ata.c: revision 1.164
	sys/dev/ata/ata_wdc.c: revision 1.115
	sys/dev/ata/ata_recovery.c: revision 1.4
	sys/dev/ic/siisata.c: revision 1.42
	sys/dev/ic/wdc.c: revision 1.308
	sys/dev/ic/mvsata.c: revision 1.56
	sys/dev/scsipi/atapi_wdc.c: revision 1.138
	sys/dev/ic/siisata.c: revision 1.49
	sys/dev/ata/atavar.h: revision 1.105
	sys/dev/ata/wd.c: revision 1.460
	sys/dev/ata/ata.c: revision 1.155
	sys/dev/ata/wd.c: revision 1.462
	sys/dev/ata/atavar.h: revision 1.109
	sys/dev/ata/satapmp_subr.c: revision 1.16
	sys/dev/ic/wdc.c: revision 1.299
	sys/dev/ic/ahcisata_core.c: revision 1.93
	sys/dev/ata/ata_wdc.c: revision 1.120
	sys/dev/ic/wdcvar.h: revision 1.100
	sys/dev/scsipi/atapi_wdc.c: revision 1.141
	sys/dev/ic/mvsata.c: revision 1.61
	sys/dev/usb/umass_isdata.c	(apply patch)

drop wd lock in wdstart1() before calling the ata_bio hook; when called
from ata thread context, that can still need to sleep for wdc attachments
in wdcwait()

fix use-after-free for ata xfer on bio submission found by KASAN
driver ata_bio hooks read parts of the xfer after ata_exec_xfer()
call in order to determine return value, change so that the hook
doesn't return any value - callers do not care already,
as all I/O requests are asynchronous

this problem was uncovered by recent change for wd(4) to not hold
wd mutex during ata_bio call, the interrupt for the xfer might
thus actually fire immediately

adjust also ata_exec_command driver hooks similarily - remove all
completion and waiting logic from drivers, upper layer ata code
using AT_WAIT/AT_POLL changed to call ata_wait_cmd() itself
PR kern/55169 by Nick Hudson

Function declaration formating whitespace consistency.  NFCI.

PR kern/56403
Fix kernel freeze for wdc(4) variants with ATAC_CAP_NOIRQ:

(1) Change ata_xfer_ops:c_poll from void to int function. When it returns
    ATAPOLL_AGAIN, let ata_xfer_start() iterate itself again.
(2) Let wdc_ata_bio_poll() return ATAPOLL_AGAIN until ATA_ITSDONE is
    achieved.

A similar change has been made for mvsata(4) (see mvsata_bio_poll()),
and no functional changes for other devices.

This is how the drivers worked before jdolecek-ncq branch was merged.
Note that this changes are less likely to cause infinite recursion:

(1) wdc_ata_bio_intr() called from wdc_ata_bio_poll() asserts ATA_ITSDONE
    in its error handling paths via wdc_ata_bio_done().
(2) Return value from c_start (= wdc_ata_bio_start()) is checked in
    ata_xfer_start().

Therefore, errors encountered in ata_xfer_ops:c_poll and c_start routines
terminate the recursion for wdc(4). The situation is similar for mvsata(4).

Still, there is a possibility where ata_xfer_start() takes long time to
finish a normal operation. This can result in a delayed response for lower
priority interrupts. But, I've never observed such a situation, even when
heavy thrashing takes place for swap partition in wd(4).
"Go ahead" by jdolecek@.

Revision 1.149.2.2 / (download) - annotate - [select for diffs], Tue Aug 30 18:28:42 2022 UTC (5 months, 1 week ago) by martin
Branch: netbsd-9
Changes since 1.149.2.1: +7 -9 lines
Diff to previous 1.149.2.1 (colored) to branchpoint 1.149 (colored)

Pull up following revision(s) (requested by tsutsui in ticket #1512):

	sys/dev/ata/ata.c: revision 1.163

Output missing '\n' for capability list when DMA support is not compiled in.

Revision 1.169 / (download) - annotate - [select for diffs], Tue May 31 08:43:15 2022 UTC (8 months, 1 week ago) by andvar
Branch: MAIN
CVS Tags: netbsd-10-base, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.168: +3 -3 lines
Diff to previous 1.168 (colored)

fix various typos in comments, documentation and messages.

Revision 1.168 / (download) - annotate - [select for diffs], Sat May 28 22:16:43 2022 UTC (8 months, 1 week ago) by andvar
Branch: MAIN
Changes since 1.167: +3 -3 lines
Diff to previous 1.167 (colored)

fix various typos in comments.

Revision 1.149.2.1 / (download) - annotate - [select for diffs], Tue Mar 15 18:00:26 2022 UTC (10 months, 3 weeks ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.149: +10 -8 lines
Diff to previous 1.149 (colored)

Pull up following revision(s) (requested by perseant in ticket #1435):

	sys/dev/ata/ata.c: revision 1.167

Avoid an unaccounted extra channel freeze, if a reset is requested
more than once before the thread services the request. Closes PR#56745.

Revision 1.167 / (download) - annotate - [select for diffs], Mon Mar 14 22:15:51 2022 UTC (10 months, 3 weeks ago) by perseant
Branch: MAIN
Changes since 1.166: +10 -8 lines
Diff to previous 1.166 (colored)

Avoid an unaccounted extra channel freeze, if a reset is requested
more than once before the thread services the request.  Closes PR#56745.

Revision 1.166 / (download) - annotate - [select for diffs], Wed Feb 23 21:54:40 2022 UTC (11 months, 1 week ago) by andvar
Branch: MAIN
Changes since 1.165: +3 -3 lines
Diff to previous 1.165 (colored)

fix various typos in comments, mainly immediatly/immediately/,
as well shared and recently fixed typos in OpenBSD code by Jonathan Grey.

Revision 1.165 / (download) - annotate - [select for diffs], Fri Nov 12 06:53:49 2021 UTC (14 months, 3 weeks ago) by skrll
Branch: MAIN
Changes since 1.164: +10 -10 lines
Diff to previous 1.164 (colored)

Trailing whitespace

Revision 1.164 / (download) - annotate - [select for diffs], Tue Oct 5 08:01:05 2021 UTC (16 months ago) by rin
Branch: MAIN
Changes since 1.163: +7 -4 lines
Diff to previous 1.163 (colored)

PR kern/56403

Fix kernel freeze for wdc(4) variants with ATAC_CAP_NOIRQ:

(1) Change ata_xfer_ops:c_poll from void to int function. When it returns
    ATAPOLL_AGAIN, let ata_xfer_start() iterate itself again.

(2) Let wdc_ata_bio_poll() return ATAPOLL_AGAIN until ATA_ITSDONE is
    achieved.

A similar change has been made for mvsata(4) (see mvsata_bio_poll()),
and no functional changes for other devices.

This is how the drivers worked before jdolecek-ncq branch was merged.

Note that this changes are less likely to cause infinite recursion:

(1) wdc_ata_bio_intr() called from wdc_ata_bio_poll() asserts ATA_ITSDONE
    in its error handling paths via wdc_ata_bio_done().

(2) Return value from c_start (= wdc_ata_bio_start()) is checked in
    ata_xfer_start().

Therefore, errors encountered in ata_xfer_ops:c_poll and c_start routines
terminate the recursion for wdc(4). The situation is similar for mvsata(4).

Still, there is a possibility where ata_xfer_start() takes long time to
finish a normal operation. This can result in a delayed response for lower
priority interrupts. But, I've never observed such a situation, even when
heavy thrashing takes place for swap partition in wd(4).

"Go ahead" by jdolecek@.

Revision 1.163 / (download) - annotate - [select for diffs], Sun Aug 29 23:49:32 2021 UTC (17 months, 1 week ago) by rin
Branch: MAIN
Changes since 1.162: +7 -9 lines
Diff to previous 1.162 (colored)

Output missing '\n' for capability list when DMA support is not compiled in.

Revision 1.162 / (download) - annotate - [select for diffs], Sat Aug 7 16:19:09 2021 UTC (17 months, 4 weeks ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Changes since 1.161: +4 -6 lines
Diff to previous 1.161 (colored)

Merge thorpej-cfargs2.

Revision 1.161.8.1 / (download) - annotate - [select for diffs], Wed Aug 4 17:27:29 2021 UTC (18 months ago) by thorpej
Branch: thorpej-cfargs2
Changes since 1.161: +4 -6 lines
Diff to previous 1.161 (colored) next main 1.162 (colored)

Adapt to CFARGS().

Revision 1.161 / (download) - annotate - [select for diffs], Sat Apr 24 23:36:52 2021 UTC (21 months, 1 week ago) by thorpej
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x
Branch point for: thorpej-cfargs2
Changes since 1.160: +9 -6 lines
Diff to previous 1.160 (colored)

Merge thorpej-cfargs branch:

Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).

Revision 1.160.4.1 / (download) - annotate - [select for diffs], Fri Apr 2 22:17:43 2021 UTC (22 months ago) by thorpej
Branch: thorpej-cfargs
Changes since 1.160: +9 -6 lines
Diff to previous 1.160 (colored) next main 1.161 (colored)

config_found_ia() -> config_found() w/ CFARG_IATTR.

Revision 1.160 / (download) - annotate - [select for diffs], Sat Oct 3 22:32:50 2020 UTC (2 years, 4 months ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base
Branch point for: thorpej-cfargs
Changes since 1.159: +4 -4 lines
Diff to previous 1.159 (colored)

autoconf: Blame devices holding up boot with config_pending.

Blame message requires `boot -x' (AB_DEBUG).

Fix ata so it doesn't mismatch config_pending_incr/decr devices.

Revision 1.159 / (download) - annotate - [select for diffs], Mon May 25 19:05:30 2020 UTC (2 years, 8 months ago) by jdolecek
Branch: MAIN
Changes since 1.158: +16 -5 lines
Diff to previous 1.158 (colored)

disable downgrade of ATA mode from DMA, as generally not relevant
any more - while it has been instrumental to inadvertedly discover
driver bugs in PIO mode under QEMU recently, generally the switch
more hurts than helps, so now only warn when DMA errors happen

code kept under ATA_DOWNGRADE_MODE ifdef, disabled by default

Revision 1.158 / (download) - annotate - [select for diffs], Mon May 25 18:29:25 2020 UTC (2 years, 8 months ago) by jdolecek
Branch: MAIN
Changes since 1.157: +7 -3 lines
Diff to previous 1.157 (colored)

make ata_downgrade_mode() static, it's not used anywhere else

Revision 1.157 / (download) - annotate - [select for diffs], Sat May 2 19:09:56 2020 UTC (2 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.156: +42 -56 lines
Diff to previous 1.156 (colored)

Back out changes to use a threadpool for now; it's causing trouble
for some folks on Thinkpads.

Revision 1.154.2.2 / (download) - annotate - [select for diffs], Sat Apr 25 11:23:59 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.154.2.1: +58 -44 lines
Diff to previous 1.154.2.1 (colored) to branchpoint 1.154 (colored) next main 1.155 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.156 / (download) - annotate - [select for diffs], Sat Apr 25 00:07:27 2020 UTC (2 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.155: +58 -44 lines
Diff to previous 1.155 (colored)

Rather than creating a kthread-per-channel, use a threadpool and a
threadpool-job-per-channel for the in-thread-context work that needs
to be done (which is rare).

On one of my test systems, this results in the total number of LWPs
after multi-user boot dropping from 116 to 78.

Revision 1.141.4.4 / (download) - annotate - [select for diffs], Tue Apr 21 18:42:15 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.141.4.3: +4 -12 lines
Diff to previous 1.141.4.3 (colored) to branchpoint 1.141 (colored) next main 1.142 (colored)

Sync with HEAD

Revision 1.154.2.1 / (download) - annotate - [select for diffs], Mon Apr 20 11:29:03 2020 UTC (2 years, 9 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.154: +6 -14 lines
Diff to previous 1.154 (colored)

Sync with HEAD

Revision 1.155 / (download) - annotate - [select for diffs], Mon Apr 13 10:49:34 2020 UTC (2 years, 9 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base1
Changes since 1.154: +6 -14 lines
Diff to previous 1.154 (colored)

fix use-after-free for ata xfer on bio submission found by KASAN

driver ata_bio hooks read parts of the xfer after ata_exec_xfer()
call in order to determine return value, change so that the hook
doesn't return any value - callers do not care already,
as all I/O requests are asynchronous

this problem was uncovered by recent change for wd(4) to not hold
wd mutex during ata_bio call, the interrupt for the xfer might
thus actually fire immediately

adjust also ata_exec_command driver hooks similarily - remove all
completion and waiting logic from drivers, upper layer ata code
using AT_WAIT/AT_POLL changed to call ata_wait_cmd() itself

PR kern/55169 by Nick Hudson

Revision 1.141.4.3 / (download) - annotate - [select for diffs], Mon Apr 13 08:04:18 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.141.4.2: +13 -9 lines
Diff to previous 1.141.4.2 (colored) to branchpoint 1.141 (colored)

Mostly merge changes from HEAD upto 20200411

Revision 1.141.4.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:03 2020 UTC (2 years, 9 months ago) by martin
Branch: phil-wifi
Changes since 1.141.4.1: +15 -14 lines
Diff to previous 1.141.4.1 (colored) to branchpoint 1.141 (colored)

Merge changes from current as of 20200406

Revision 1.154 / (download) - annotate - [select for diffs], Sat Apr 4 21:36:15 2020 UTC (2 years, 10 months ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.153: +15 -14 lines
Diff to previous 1.153 (colored)

fix deadlock in wdcwait() when xfer timeout happens while the atabus
thread sleeps in wdcwait() - check current lwp rather than relying
on global ATACH_TH_RUN channel flag

should fix the hang part of the problem reported in
http://mail-index.netbsd.org/netbsd-users/2020/03/12/msg024249.html

thanks to Paul Ripke for providing extensive debugging info

Revision 1.153 / (download) - annotate - [select for diffs], Mon Oct 21 18:58:57 2019 UTC (3 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20191119, is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Changes since 1.152: +14 -6 lines
Diff to previous 1.152 (colored)

chuq does not like insomniac allocations so unlock-alloc-lock instead.

Revision 1.152 / (download) - annotate - [select for diffs], Mon Oct 21 18:37:47 2019 UTC (3 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.151: +5 -3 lines
Diff to previous 1.151 (colored)

Fix assert_sleepable() panic by allocating with NOSLEEP. The alternative is
to unlock and relock the channel, but seems more dangerous to do so.

Revision 1.151 / (download) - annotate - [select for diffs], Tue Oct 15 00:13:53 2019 UTC (3 years, 3 months ago) by chs
Branch: MAIN
Changes since 1.150: +3 -9 lines
Diff to previous 1.150 (colored)

convert more KM_NOSLEEP to KM_SLEEP and remove code to handle failures.

Revision 1.150 / (download) - annotate - [select for diffs], Wed Aug 21 04:51:41 2019 UTC (3 years, 5 months ago) by msaitoh
Branch: MAIN
Changes since 1.149: +3 -3 lines
Diff to previous 1.149 (colored)

 Fix typo (s/controler/controller/).

Revision 1.141.4.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:05 2019 UTC (3 years, 7 months ago) by christos
Branch: phil-wifi
Changes since 1.141: +316 -277 lines
Diff to previous 1.141 (colored)

Sync with HEAD

Revision 1.149 / (download) - annotate - [select for diffs], Sat May 25 16:30:18 2019 UTC (3 years, 8 months ago) by christos
Branch: MAIN
CVS Tags: phil-wifi-20190609, netbsd-9-base, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1
Branch point for: netbsd-9
Changes since 1.148: +4 -13 lines
Diff to previous 1.148 (colored)

use PR_ZERO

Revision 1.148 / (download) - annotate - [select for diffs], Sat Apr 6 00:35:25 2019 UTC (3 years, 10 months ago) by uwe
Branch: MAIN
CVS Tags: isaki-audio2-base, isaki-audio2
Changes since 1.147: +5 -3 lines
Diff to previous 1.147 (colored)

Make sure the aprint_verbose chain is terminated with a newline.
Check sep instead of printed, b/c the latter is reset several times.

Revision 1.141.2.2 / (download) - annotate - [select for diffs], Wed Dec 26 14:01:47 2018 UTC (4 years, 1 month ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.141.2.1: +12 -11 lines
Diff to previous 1.141.2.1 (colored) to branchpoint 1.141 (colored) next main 1.142 (colored)

Sync with HEAD, resolve a few conflicts

Revision 1.147 / (download) - annotate - [select for diffs], Tue Dec 11 23:06:30 2018 UTC (4 years, 1 month ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226
Changes since 1.146: +12 -11 lines
Diff to previous 1.146 (colored)

in atabus_detach(), shutdown the channel thread only after all the
children successfully detach; this is especially important for
atapibus, which needs the thread to execute commands

fixes hang on poweroff with root on ATAPI cd(4), reported by Christoph Badura

Revision 1.141.2.1 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:30 2018 UTC (4 years, 2 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.141: +312 -267 lines
Diff to previous 1.141 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.146 / (download) - annotate - [select for diffs], Mon Nov 12 18:51:01 2018 UTC (4 years, 2 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-compat-1126
Changes since 1.145: +6 -2 lines
Diff to previous 1.145 (colored)

hold channel lock during whole ata_dmaerr()/ata_downgrade_mode() -
according to code inspection this is safe, none of the set_modes
hooks execute anything which would be taking the lock

adresses PR kern/53714 by Andreas Gustafsson

Revision 1.145 / (download) - annotate - [select for diffs], Wed Oct 24 20:25:52 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.144: +4 -2 lines
Diff to previous 1.144 (colored)

ata_kill_active() needs to drop channel drop before calling kill_xfer() hook,
otherwise code tries to lock against itself when deactivating the xfer

Revision 1.144 / (download) - annotate - [select for diffs], Wed Oct 24 20:01:13 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.143: +10 -2 lines
Diff to previous 1.143 (colored)

add further note about FIS-based switching to atastart()

Revision 1.143 / (download) - annotate - [select for diffs], Wed Oct 24 19:38:00 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.142: +4 -2 lines
Diff to previous 1.142 (colored)

detach the controller itself on shutdown; adjust to not detach already
detached atabus/channel

Revision 1.142 / (download) - annotate - [select for diffs], Mon Oct 22 20:13:47 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.141: +296 -267 lines
Diff to previous 1.141 (colored)

Merge jdolecek-ncqfixes branch

- ata_xfer's are dynamicall allocated as needed using a pool, no longer
  limited to number of possible openings supported by controller; dump
  and recovery paths use dedicated pre-allocated storage
- moved callouts and condvars from ata_xfer to queue or channel, so that
  ata_xfer does not need special initialization
- slot allocation now done when xfer is being activated, uncoupled
  from memory allocation; active slots are no longer tracked by controller
  code
- channel and drive reset is done always via the atabus thread, and
  now executes with channel locked the whole time
- NCQ recovery moved to shared function, and run via the thread also
- added some workarounds for buggy error recovery AHCI emulation in QEMU
  and Parallels

designed to primarily fix kern/52614, but might also help with kern/47041
and kern/53183

Revision 1.141.6.18 / (download) - annotate - [select for diffs], Mon Oct 15 21:18:53 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.17: +53 -20 lines
Diff to previous 1.141.6.17 (colored) to branchpoint 1.141 (colored) next main 1.142 (colored)

change the SATA/NCQ recovery to run in the atabus thread

Revision 1.141.6.17 / (download) - annotate - [select for diffs], Sun Oct 14 16:13:51 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.16: +3 -2 lines
Diff to previous 1.141.6.16 (colored) to branchpoint 1.141 (colored)

add comment to kthread_create() call to explain why atabus_thread is actually
running under KERNEL_LOCK()

Revision 1.141.6.16 / (download) - annotate - [select for diffs], Thu Oct 11 20:57:51 2018 UTC (4 years, 3 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.15: +2 -94 lines
Diff to previous 1.141.6.15 (colored) to branchpoint 1.141 (colored)

refactor shared parts of the SATA error recovery into new function
ata_recovery_resume() and use for ahcisata/siisata/mvsata, also replace
per-controller hold/unhold with generic version

move the shared recovery code into separate file ata_recovery.c

Revision 1.141.6.15 / (download) - annotate - [select for diffs], Sat Oct 6 21:19:55 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.14: +18 -26 lines
Diff to previous 1.141.6.14 (colored) to branchpoint 1.141 (colored)

actually, just make dump use the same queue skip as recovery, and remove the
no longer necessary ata_queue_reset() call from wd(4)

also for PR kern/47041

Revision 1.141.6.14 / (download) - annotate - [select for diffs], Sat Oct 6 20:27:36 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.13: +4 -17 lines
Diff to previous 1.141.6.13 (colored) to branchpoint 1.141 (colored)

remove AT_RST_EMERG, do the queue reset explicitly in wd(4)

this should explicitly fix PR kern/47041 with sync during heavy
disk activity, even thought it was actually already implicitly fixed by calling
ata_thread_run() for drive reset in previous commit already, since the
function already called ata_queue_reset()

drop now unused ch_reset_flags and drive_reset_flags

Revision 1.141.6.13 / (download) - annotate - [select for diffs], Sat Oct 6 20:13:12 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.12: +2 -3 lines
Diff to previous 1.141.6.12 (colored) to branchpoint 1.141 (colored)

remove extra newline

Revision 1.141.6.12 / (download) - annotate - [select for diffs], Sat Oct 6 20:12:37 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.11: +22 -17 lines
Diff to previous 1.141.6.11 (colored) to branchpoint 1.141 (colored)

fix ata_thread_run() for drive reset to set and check correct drive_flags

Revision 1.141.6.11 / (download) - annotate - [select for diffs], Wed Oct 3 19:20:48 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.10: +86 -60 lines
Diff to previous 1.141.6.10 (colored) to branchpoint 1.141 (colored)

change channel reset and drive reset for all ATA controllers to always
run via thread, and with channel lock held the whole time; the queue is
frozen while reset is pending

for this repurpose ata_reset_channel() into new ata_thread_run()

also adjust some device printfs to not leak xfer pointer, and avoid
aprint_* for non-autoconf messages

Revision 1.141.6.10 / (download) - annotate - [select for diffs], Mon Sep 24 19:48:02 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.9: +19 -9 lines
Diff to previous 1.141.6.9 (colored) to branchpoint 1.141 (colored)

replace KASSERT() for READ LOG EXT returning without error indication
with just log to avoid triggering panic under QEMU - it doesn't implement
the command for AHCI emulation

Revision 1.141.6.9 / (download) - annotate - [select for diffs], Sat Sep 22 16:14:25 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.8: +6 -5 lines
Diff to previous 1.141.6.8 (colored) to branchpoint 1.141 (colored)

fix use-after-free in wd(4) dump, detected by switch to the pool

change code in wd_dumpblocks() to use it's own non-pool ata_xfer,
which skips the deallocation step and thus keeps the contents when the I/O
is finished

Revision 1.141.6.8 / (download) - annotate - [select for diffs], Sat Sep 22 12:20:31 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.7: +3 -3 lines
Diff to previous 1.141.6.7 (colored) to branchpoint 1.141 (colored)

revert atabus_alloc_drives() to use KM_NOSLEEP again - it's called with
ch_lock held hence cannot actually sleep, fixing is out of scope of the branch

Revision 1.141.6.7 / (download) - annotate - [select for diffs], Sat Sep 22 09:26:48 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.6: +3 -3 lines
Diff to previous 1.141.6.6 (colored) to branchpoint 1.141 (colored)

use KM_SLEEP in atabus_alloc_drives() to avoid spurious failures; this is
not called from interrupt context

Revision 1.141.6.6 / (download) - annotate - [select for diffs], Sat Sep 22 09:22:59 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.5: +114 -24 lines
Diff to previous 1.141.6.5 (colored) to branchpoint 1.141 (colored)

separate ata_xfer slot allocation and the memory allocation, so that
there can be more queued xfers than number of supported slots by controller,
and use a pool instead of custom pre-allocation

primarily to help PR kern/52614

remove no longer needed custom wd(4) logic for flush cache

switch also wd(4) trim/suspend/setcache/wdioctlstrategy to sleep waiting
for the memory, they are all called from process context and this
avoids spurious failures

Revision 1.141.6.5 / (download) - annotate - [select for diffs], Mon Sep 17 20:54:41 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.4: +10 -11 lines
Diff to previous 1.141.6.4 (colored) to branchpoint 1.141 (colored)

convert from malloc()/free() to kmem_zalloc()/kmem_free()

Revision 1.141.6.4 / (download) - annotate - [select for diffs], Mon Sep 17 19:00:43 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.3: +11 -10 lines
Diff to previous 1.141.6.3 (colored) to branchpoint 1.141 (colored)

switch from TAILQ to SIMPLEQ for ata_xfer pending queue to save
space, don't need doubly linked queue

Revision 1.141.6.3 / (download) - annotate - [select for diffs], Mon Sep 17 18:36:13 2018 UTC (4 years, 4 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.2: +10 -10 lines
Diff to previous 1.141.6.2 (colored) to branchpoint 1.141 (colored)

move low-level protocol handlers hooks from ata_xfer to separate struct,
initialized statically

primarily to reduce ata_xfer struct size, but also improves readibility,
and enforces consistency

Revision 1.141.6.2 / (download) - annotate - [select for diffs], Sat Sep 1 09:48:32 2018 UTC (4 years, 5 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141.6.1: +4 -6 lines
Diff to previous 1.141.6.1 (colored) to branchpoint 1.141 (colored)

stop assuming c_slot is immutable, use the xfer pointer rather than c_slot
in printfs()

Revision 1.141.6.1 / (download) - annotate - [select for diffs], Fri Aug 31 19:08:03 2018 UTC (4 years, 5 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.141: +29 -50 lines
Diff to previous 1.141 (colored)

refactor ata_xfer to be just dumb structure; move all callouts/condvars out

retry callout to wd(4); reset callout and the active/cmd finish condvars
to channel queue; change code using the condvars so it works if there
are multiple waiters

simplify the async wait code for cmds, replace ata_wait_xfer()/ata_wake_xfer()
with ata_wait_cmd()

fix the callout_invoking/ack race handling code for timeouts to
actually have chance to work; change mvsata(4) to use generic timeout func

towards resolution of kern/52614

Revision 1.125.2.4 / (download) - annotate - [select for diffs], Sun Dec 3 11:36:59 2017 UTC (5 years, 2 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.125.2.3: +802 -230 lines
Diff to previous 1.125.2.3 (colored) to branchpoint 1.125 (colored) next main 1.126 (colored)

update from HEAD

Revision 1.141 / (download) - annotate - [select for diffs], Sat Oct 28 04:53:54 2017 UTC (5 years, 3 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, jdolecek-ncqfixes-base
Branch point for: phil-wifi, pgoyette-compat, jdolecek-ncqfixes
Changes since 1.140: +3 -4 lines
Diff to previous 1.140 (colored)

Kill some more extern struct cfdriver declarations.

Down with externs in .c!

Revision 1.140 / (download) - annotate - [select for diffs], Fri Oct 20 07:06:07 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.139: +4 -4 lines
Diff to previous 1.139 (colored)

move ata_queue_alloc(1) and ata_queue_free() calls to ata_channel_init()
and ata_channel_destroy() respectively, to make attachment code simpler,
and to make it easier to spot special queue manipulation like cmdide(4)

on topic of PR kern/52606

Revision 1.139 / (download) - annotate - [select for diffs], Thu Oct 19 20:45:07 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.138: +6 -6 lines
Diff to previous 1.138 (colored)

more detailed debug info; also sync DEBUG_* values in wd.c with ata.c

Revision 1.138 / (download) - annotate - [select for diffs], Wed Oct 18 08:38:35 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.137: +4 -4 lines
Diff to previous 1.137 (colored)

add newlines to the debug messages

Revision 1.137 / (download) - annotate - [select for diffs], Sun Oct 15 14:41:06 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.136: +65 -20 lines
Diff to previous 1.136 (colored)

move the extra thaw for scheduled ata_reset_channel() to the function itself,
so it's done regardless if the actual reset is run from thread context
or e.g. call with AT_POLL; fixes a hang after xfer failure and dma downgrade

add some debugging printfs, so freeze/thaw issues are easier to track

Revision 1.136 / (download) - annotate - [select for diffs], Tue Oct 10 17:19:38 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.135: +2 -364 lines
Diff to previous 1.135 (colored)

split off functions used by 'wd* at umass?' into separate file, unfortunately
the previous approach with NATABUS doesn't work for kernels which include
MODULAR, but not atabus - such as macppc and evbarm

Revision 1.135 / (download) - annotate - [select for diffs], Sun Oct 8 19:00:29 2017 UTC (5 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.134: +17 -9 lines
Diff to previous 1.134 (colored)

as a stopgap measure, include necessary parts of dev/ata/ata.c even
if no atabus is configured, so that kernels with just 'wd* at umass?'
and no atabus compile; fixes kernel builds for vax, pmax and evbmips
after NCQ branch merge

XXX wd* at umass? still actually untested after the merge, need to discuss
XXX what to do with it

Revision 1.134 / (download) - annotate - [select for diffs], Sun Oct 8 04:52:33 2017 UTC (5 years, 4 months ago) by mlelstv
Branch: MAIN
Changes since 1.133: +4 -3 lines
Diff to previous 1.133 (colored)

Don't assert channel lock in polled mode.

ahcisata (and maybe others) use ata_delay during initialization where
lock isn't taken.

Revision 1.133 / (download) - annotate - [select for diffs], Sat Oct 7 16:05:32 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: MAIN
Changes since 1.132: +1083 -202 lines
Diff to previous 1.132 (colored)

Merge support for SATA NCQ (Native Command Queueing) from jdolecek-ncq branch

ATA subsystem was changed to support several outstanding commands, and use
NCQ xfers if supported by both the controller and the disk, including NCQ
error recovery. Set NCQ high priority for BPRIO_TIMECRITICAL xfers
if supported. Added FUA support.

Done some work towards MP-safe, all ATA code tsleep()/wakeup() replaced
by condvars, and switched most code from spl* to mutexes (separate
wd(4) and ata channel lock).

Introduced new option WD_CHAOS_MONKEY to facilitate testing of error
handling, fixed several uncovered issues. Also fixed several problems
with kernel dump to wd(4) disk.

Tested with ahcisata(4), mvsata(4), siisata(4), piixide(4) on amd64,
with and without port multiplier, both disk and ATAPI devices; other
drivers and archs mechanically adjusted and compile-tested. NCQ is
supported for ahcisata(4) and siisata(4) for any controller, for
mvsata(4) only Gen IIe ones for now. Also enabled ATAPI support in
mvsata(4).

Thanks to Matt Thomas for initial ATA infrastructure patch, and
Jonathan A.Kollasch for siisata(4) NCQ changes and general testing.

Also fixes PR kern/43169 (wd(4)); and PR kern/11811, PR kern/47041,
PR kern/51979 (kernel dump)

Revision 1.132.8.39 / (download) - annotate - [select for diffs], Fri Sep 29 20:05:07 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.38: +8 -8 lines
Diff to previous 1.132.8.38 (colored) to branchpoint 1.132 (colored) next main 1.133 (colored)

introduce ATA_BSIZE and use it instead of DEV_BSIZE for get params and
recovery, where they are by spec 512 bytes and not negotiable

Revision 1.132.8.38 / (download) - annotate - [select for diffs], Wed Sep 27 19:05:57 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.37: +9 -2 lines
Diff to previous 1.132.8.37 (colored) to branchpoint 1.132 (colored)

restore the atac_claim_hw and atac_free_hw hooks, they are used on atari

Revision 1.132.8.37 / (download) - annotate - [select for diffs], Mon Sep 25 22:43:46 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.36: +30 -13 lines
Diff to previous 1.132.8.36 (colored) to branchpoint 1.132 (colored)

put recovery command on head of active xfers queue, so that drivers using
ata_queue_get_active_xfer() like mvsata(4) will find it and not random other
NCQ xfer

never return NCQ xfer from ata_queue_get_active_xfer(), if the first xfer
is NCQ simply return NULL

adjust ata_timo_xfer_check() to not check the expiring flag in C_WAITTIMO
branch, if we get there we ought to get the timeout handler aborted

Revision 1.132.8.36 / (download) - annotate - [select for diffs], Sat Sep 23 14:53:26 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.35: +2 -2 lines
Diff to previous 1.132.8.35 (colored) to branchpoint 1.132 (colored)

note to previous: the KASSERT() insisted actually there is at most one
active xfer, which is false during NCQ error recovery

Revision 1.132.8.35 / (download) - annotate - [select for diffs], Sat Sep 23 13:13:19 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.34: +2 -5 lines
Diff to previous 1.132.8.34 (colored) to branchpoint 1.132 (colored)

remove ata_queue_get_active_xfer() KASSERT() about having at least one
active xfer; it can happen we get interrupt while no longer having the cmd
active e.g. during recovery, and all callers handle getting NULL as result

fixes panic in mvsata(4) during error recovery

Revision 1.132.8.34 / (download) - annotate - [select for diffs], Wed Sep 20 19:39:36 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.33: +3 -2 lines
Diff to previous 1.132.8.33 (colored) to branchpoint 1.132 (colored)

add forgotten destroy of queue_idle cv in ata_queue_free()

Revision 1.132.8.33 / (download) - annotate - [select for diffs], Tue Sep 19 21:06:25 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.32: +56 -31 lines
Diff to previous 1.132.8.32 (colored) to branchpoint 1.132 (colored)

replace all remaining tsleep()/wakeup() calls with condition variables, or
calls to ata_delay(), as appropriate; change ata_delay() to require the
channel lock on entry, and pass the lock to kpause() for unlocking while
sleeping

Revision 1.132.8.32 / (download) - annotate - [select for diffs], Mon Sep 11 22:16:18 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.31: +4 -4 lines
Diff to previous 1.132.8.31 (colored) to branchpoint 1.132 (colored)

move debug printf where it belongs

Revision 1.132.8.31 / (download) - annotate - [select for diffs], Sun Sep 10 19:31:15 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.30: +163 -83 lines
Diff to previous 1.132.8.30 (colored) to branchpoint 1.132 (colored)

refactor code so that xfer c_start() hook is called with channel mutex held,
and hence the controller submit code no longer relies on spl

tested all the affected drivers - wdc (via piixide), ahci, mvsata, siisata,
both disk and atapi I/O

Revision 1.132.8.30 / (download) - annotate - [select for diffs], Sun Sep 10 19:22:56 2017 UTC (5 years, 4 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.29: +7 -3 lines
Diff to previous 1.132.8.29 (colored) to branchpoint 1.132 (colored)

fix regression in atabus_thread() when it was converted from spl to mutex -
the reset and c_start() routines expect to run on splbio; wrap the calls
insite splbio/splx() again for now, since we can't hold the mutex while calling
them

fixes problem experienced by Jonathan, where drive setup triggered
an spurious interrupt and panic due to state < READY

Revision 1.132.8.29 / (download) - annotate - [select for diffs], Tue Aug 15 11:21:32 2017 UTC (5 years, 5 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.28: +8 -8 lines
Diff to previous 1.132.8.28 (colored) to branchpoint 1.132 (colored)

explicitly do not try to activate any further commands when running recovery
xfer; it was kind of implied since the code would not queue another non-NCQ
command when non-NCQ command is active, but this is better for readibility

Revision 1.132.8.28 / (download) - annotate - [select for diffs], Sat Aug 12 22:31:50 2017 UTC (5 years, 5 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.27: +3 -3 lines
Diff to previous 1.132.8.27 (colored) to branchpoint 1.132 (colored)

use AT_LBA48 flag for the READ LOG EXT - it's required so that e.g. mvsata()
executes the command using wdccommandext(), it fails when executed using
wdccommand()

Revision 1.132.8.27 / (download) - annotate - [select for diffs], Sat Aug 12 15:08:38 2017 UTC (5 years, 5 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.26: +6 -2 lines
Diff to previous 1.132.8.26 (colored) to branchpoint 1.132 (colored)

take atabus_qlock while inserting into atabus_initq_head to avoid race
in attach and rescan; just cleanup, noticed this while doing the thread
locking, don't think there is realistic way to trigger this

Revision 1.132.8.26 / (download) - annotate - [select for diffs], Sat Aug 12 14:41:54 2017 UTC (5 years, 5 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.25: +75 -36 lines
Diff to previous 1.132.8.25 (colored) to branchpoint 1.132 (colored)

convert the atabus thread to use the channel lock and a condvar, adjust
code which sets the relevant channel flags to take the lock while doing so

Revision 1.132.8.25 / (download) - annotate - [select for diffs], Sat Aug 12 09:52:28 2017 UTC (5 years, 5 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.24: +12 -11 lines
Diff to previous 1.132.8.24 (colored) to branchpoint 1.132 (colored)

remove all logic around ATACH_IRQ_WAIT and channel-global ch_error/ch_status,
so that there is less hidden state shared by commands; primary intent is
to make the NCQ and non-NCQ paths more similar, and remove possibility
of incorrect handling for the NCQ commands

tested both disk and ATAPI - piixide(4) on QEMU, and siisata(4),
ahcisata(4), mvsata(4) on real hw

Revision 1.132.8.24 / (download) - annotate - [select for diffs], Tue Aug 1 21:41:25 2017 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.23: +8 -2 lines
Diff to previous 1.132.8.23 (colored) to branchpoint 1.132 (colored)

make atastart() schedule as many commands as possible, instead of always
only one; makes it able to pick up pace again after processing non-NCQ command

Revision 1.132.8.23 / (download) - annotate - [select for diffs], Tue Aug 1 21:39:51 2017 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.22: +3 -3 lines
Diff to previous 1.132.8.22 (colored) to branchpoint 1.132 (colored)

move the drive recovery block to drive struct, it's inherently per-drive

Revision 1.132.8.22 / (download) - annotate - [select for diffs], Sat Jul 29 12:58:29 2017 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.21: +62 -38 lines
Diff to previous 1.132.8.21 (colored) to branchpoint 1.132 (colored)

reserve the highest slot for error recovery, and also have ata_channel
include space for the READ LOG EXT sector, so that it's not necessary
to allocate memory on the error handling path; now ata_read_log_ext_ncq()
will never fail due to resource shortage

Revision 1.132.8.21 / (download) - annotate - [select for diffs], Sat Jul 22 22:02:21 2017 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.20: +7 -2 lines
Diff to previous 1.132.8.20 (colored) to branchpoint 1.132 (colored)

provide channel flag when executing NCQ commands, so that e.g. intr
handler can use this for handling decisions without checking xfer

Revision 1.132.8.20 / (download) - annotate - [select for diffs], Fri Jul 21 18:12:37 2017 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.19: +16 -7 lines
Diff to previous 1.132.8.19 (colored) to branchpoint 1.132 (colored)

add checksum verification for data returned by READ LOG EXT; this is mostly
just paranoia for eventual driver/hw DMA bugs

this doesn't make difference for QEMU, as there the command actually always
just fails (it's not implemented)

Revision 1.132.8.19 / (download) - annotate - [select for diffs], Wed Jul 19 19:39:28 2017 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.18: +218 -32 lines
Diff to previous 1.132.8.18 (colored) to branchpoint 1.132 (colored)

tighen and expand error handling, mostly for NCQ use cases:
- make retry timeout callout per xfer, i.e. retry separately
- zero whole bio struct on retry to avoid more stale state
- add a REQUEUE option, which doesn't bump retry count
- add ata_read_log_ext_ncq() for NCQ recovery
- adjust logic for activating xfers - allow next command only when
  it's for same drive, several concurrent are only supported when HBA
  and driver support FIS-based switching
- add new ata_timeout() which handles race between callout_stop()
  and the invokation, add appropriate handling on deactivate/free paths
- stop using ch_status/ch_error in non-wdc code; later it will be dropped
  completely

Revision 1.132.8.18 / (download) - annotate - [select for diffs], Tue Jun 27 18:36:03 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.17: +73 -39 lines
Diff to previous 1.132.8.17 (colored) to branchpoint 1.132 (colored)

attend error paths, more strict asserts and code consistency

- atastart() and ata_kill_pending() now KASSERT() that all xfers on queue
  have same channel
- inactive xfers are killed via new reason KILL_GONE_INACTIVE, controller
  code must not call any resource deactivation in that case
- c_intr() must call ata_waitdrain_xfer_check() as first thing, and must not
  further touch any xfer structures on exit path; any resource cleanup
  is supposed to be done in c_kill_xfer()
- c_kill_xfer() should never call atastart()
- ata_waitdrain_check() removed, replaced by ata_waitdrain_xfer_check()
- ATA_DRIVE_WAITDRAIN handling converted to use condvar
- removed unused ata_c callback

Revision 1.132.8.17 / (download) - annotate - [select for diffs], Sat Jun 24 14:57:17 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.16: +4 -3 lines
Diff to previous 1.132.8.16 (colored) to branchpoint 1.132 (colored)

change ata_delay() to tsleep for 1 hz rather than indefinitely if
provided ms is lower than 1 hz

Revision 1.132.8.16 / (download) - annotate - [select for diffs], Fri Jun 23 20:40:51 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.15: +46 -2 lines
Diff to previous 1.132.8.15 (colored) to branchpoint 1.132 (colored)

restart I/O processing after freeing xfer, i.e. now even after commands
like cache flush or standby; the command handling no longer use on-stack xfer,
hence use queue slot and compete with normal I/O for the xfers

the restart give change to all drives attached to the same channel
in round-robin fashion, for fair usage and to recover from situation
when disk is idle due to all xfers being consumed by other drives

make special concession for flush cache - ignore any new I/O requests
on the particular disk while the flush cache is waiting for xfer,
so that I/O queue won't starve the flush cache and the flush cache would
be done ASAP

tested on piixide(4), ahci(4), siisata(4)

Revision 1.132.8.15 / (download) - annotate - [select for diffs], Wed Jun 21 22:40:43 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.14: +40 -16 lines
Diff to previous 1.132.8.14 (colored) to branchpoint 1.132 (colored)

hold channel lock for ata_exec_xfer() and most of atastart(), convert
C_WAITACT handling to use condvar

add comment for the code block with C_FREE and ata_free_xfer() explaining
why it's not abstraction layer violation

Revision 1.132.8.14 / (download) - annotate - [select for diffs], Wed Jun 21 22:34:46 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.13: +43 -34 lines
Diff to previous 1.132.8.13 (colored) to branchpoint 1.132 (colored)

two last forgotten on-stack xfers replaced with using the queue xfer -
ata_get_params() and ata_set_mode()

fix wdc_atapi_get_params() to free the xfer used for soft reset before
calling ata_get_params() - it's now necessary, as ata_get_params() doesn't
invent a private xfer own any more

Revision 1.132.8.13 / (download) - annotate - [select for diffs], Wed Jun 21 19:38:43 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.12: +26 -10 lines
Diff to previous 1.132.8.12 (colored) to branchpoint 1.132 (colored)

change ata_queue_hwslot_to_xfer() and ata_queue_get_active_xfer() to take
ata_channel instead of ata_queue as parameter, and lock the channel while
traversing the queue

Revision 1.132.8.12 / (download) - annotate - [select for diffs], Tue Jun 20 20:58:22 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.11: +47 -41 lines
Diff to previous 1.132.8.11 (colored) to branchpoint 1.132 (colored)

remove ata queue downsizing - every device, attached to the same channel,
uses slots according to it's own limits

wdc code changed to expect maximum one active xfer, and not check number
of openings in the channel; this is to facilitate using wdc functions
for e.g. handling of atapi commands  for drivers which support both ATAPI
and NCQ

Revision 1.132.8.11 / (download) - annotate - [select for diffs], Mon Jun 19 21:00:00 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.10: +72 -16 lines
Diff to previous 1.132.8.10 (colored) to branchpoint 1.132 (colored)

add ata_channel lock, use it to protect queue manipulation (only that for now);
add ata_channel_detach() to destroy the locks

change ata_get_xfer() so that it can wait for xfer, convert all on-stack
xfer code to use the blocking variant

fix siisata_reset_drive() to use polled reset and not try ata_activate_xfer(),
convert drive probe code also over from slot0 XXX to ata_get_xfer()

drive reset and PMP now works on siisata(4) too; changes tested also
on piixide(4), ahci(4), mvsata(4)

Revision 1.132.8.10 / (download) - annotate - [select for diffs], Sat Jun 17 14:01:36 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.9: +2 -4 lines
Diff to previous 1.132.8.9 (colored) to branchpoint 1.132 (colored)

make PMP working great again

tested with mvsata(4), my ahcisata(4) controller unfortunately doesn't
support PMP

Revision 1.132.8.9 / (download) - annotate - [select for diffs], Fri Jun 16 20:40:49 2017 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.8: +28 -7 lines
Diff to previous 1.132.8.8 (colored) to branchpoint 1.132 (colored)

adjust reset channel and dump paths
- channel reset now always kills active transfer, even on dump path, but
  now doesn't touch the queued waiting transfers; also kill_xfer hook is
  always called, so that HBA can free any private xfer resources and thus
  the dump request has chance to work
- kill_xfer routines now always call ata_deactivate_xfer(); added KASSERT()s
  to ata_free_xfer() to expect deactivated xfer
- when called during channel reset before dump, ata_kill_active() drops
  any queued waiting transfers without processing
- do not (re)queue any transfers in wddone() when dumping
- kill AT_RST_NOCMD flag

This should also hopefully fix the 'polled command has been queued' panic
as reported in:
PR kern/11811 by John Hawkinson
PR kern/47041 by Taylor R Campbell
PR kern/51979 by Martin Husemann

dump tested working with piixide(4) and ahci(4). mvsata(4) dump times out,
but otherwise tested working, will be fixed separately. siisata(4) mechanically
changed and not tested.

Revision 1.132.8.8 / (download) - annotate - [select for diffs], Mon Apr 24 22:20:23 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.7: +16 -6 lines
Diff to previous 1.132.8.7 (colored) to branchpoint 1.132 (colored)

set NCQ priority field to 'high' for BPRIO_TIMECRITICAL transfers if drive
supports it

Revision 1.132.8.7 / (download) - annotate - [select for diffs], Sun Apr 23 01:30:30 2017 UTC (5 years, 9 months ago) by jakllsch
Branch: jdolecek-ncq
Changes since 1.132.8.6: +4 -3 lines
Diff to previous 1.132.8.6 (colored) to branchpoint 1.132 (colored)

Use WDC_QUEUE_DEPTH_MASK to correctly mask the NCQ depth IDENTIFY data.

Revision 1.132.8.6 / (download) - annotate - [select for diffs], Wed Apr 19 21:42:39 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.5: +11 -4 lines
Diff to previous 1.132.8.5 (colored) to branchpoint 1.132 (colored)

add ATA FUA support

Revision 1.132.8.5 / (download) - annotate - [select for diffs], Wed Apr 19 20:49:17 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.4: +146 -30 lines
Diff to previous 1.132.8.4 (colored) to branchpoint 1.132 (colored)

adjust ata code to support more than one active command, including the
timeout handling, add support for NCQ commands

move probe for NCQ and number of tags to middle layer, negotiate mutual
support between drive and controller

implement NCQ support in ahci(4)

Revision 1.132.8.4 / (download) - annotate - [select for diffs], Sat Apr 15 17:14:11 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.3: +45 -36 lines
Diff to previous 1.132.8.3 (colored) to branchpoint 1.132 (colored)

pass also ata_command via ata_xfer, callers of ata_exec_command() is now
responsible for allocation/disposal of the structure

change code to allocate ata_xfer for commands on stack same way as previously
the ata_command were, using c_slot 0; adjust asserts so that it would allow
several xfers with same c_slot, as long as only one such transfer is active
at a time

Revision 1.132.8.3 / (download) - annotate - [select for diffs], Sat Apr 15 12:01:23 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.2: +44 -75 lines
Diff to previous 1.132.8.2 (colored) to branchpoint 1.132 (colored)

make ata_xfer's allocated as part of ata_queue and make it include ata_bio;
they are pre-allocated on attach and ata_get_xfer() now never sleep, drop the
pool

modify wd(4) to file the bio requests using the xfers and hence
make it possible to have more than one active I/O request in flight;
ata_bio callback doesn't need to allocate any memory any more,
require it to never return ATACMD_TRY_AGAIN

move lp, badsect, multi from ata_bio to ata_drive_datas, as they are per-drive,
not per transfer

drop unused drv atac_claim_hw/atac_free_hw hooks, and also drop again ata_bio
c_hwslot

Revision 1.132.8.2 / (download) - annotate - [select for diffs], Tue Apr 11 18:15:03 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132.8.1: +4 -2 lines
Diff to previous 1.132.8.1 (colored) to branchpoint 1.132 (colored)

hide active_xfer from drivers

Revision 1.132.8.1 / (download) - annotate - [select for diffs], Mon Apr 10 22:57:02 2017 UTC (5 years, 9 months ago) by jdolecek
Branch: jdolecek-ncq
Changes since 1.132: +202 -49 lines
Diff to previous 1.132 (colored)

ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas

Revision 1.132 / (download) - annotate - [select for diffs], Wed Sep 10 07:04:48 2014 UTC (8 years, 4 months ago) by matt
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, nick-nhusb-base-20170204, nick-nhusb-base-20161204, nick-nhusb-base-20161004, nick-nhusb-base-20160907, nick-nhusb-base-20160529, nick-nhusb-base-20160422, nick-nhusb-base-20160319, nick-nhusb-base-20151226, nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406, nick-nhusb-base, nick-nhusb, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, jdolecek-ncq-base, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: jdolecek-ncq
Changes since 1.131: +8 -8 lines
Diff to previous 1.131 (colored)

g/u_int[0-9]*_t/ s/u_int/uint/g

Revision 1.125.2.3 / (download) - annotate - [select for diffs], Wed Aug 20 00:03:35 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-maxphys
Changes since 1.125.2.2: +20 -7 lines
Diff to previous 1.125.2.2 (colored) to branchpoint 1.125 (colored)

Rebase to HEAD as of a few days ago.

Revision 1.130.2.1 / (download) - annotate - [select for diffs], Sun Aug 10 06:54:50 2014 UTC (8 years, 5 months ago) by tls
Branch: tls-earlyentropy
Changes since 1.130: +3 -2 lines
Diff to previous 1.130 (colored) next main 1.131 (colored)

Rebase.

Revision 1.131 / (download) - annotate - [select for diffs], Fri Jul 25 08:10:36 2014 UTC (8 years, 6 months ago) by dholland
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.130: +3 -2 lines
Diff to previous 1.130 (colored)

Add d_discard to all struct cdevsw instances I could find.

All have been set to "nodiscard"; some should get a real implementation.

Revision 1.115.4.4 / (download) - annotate - [select for diffs], Thu May 22 11:40:20 2014 UTC (8 years, 8 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.115.4.3: +35 -9 lines
Diff to previous 1.115.4.3 (colored) to branchpoint 1.115 (colored) next main 1.116 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.127.4.2 / (download) - annotate - [select for diffs], Sun May 18 17:45:35 2014 UTC (8 years, 8 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.127.4.1: +17 -8 lines
Diff to previous 1.127.4.1 (colored) to branchpoint 1.127 (colored) next main 1.128 (colored)

sync with head

Revision 1.130 / (download) - annotate - [select for diffs], Sun Mar 16 05:20:27 2014 UTC (8 years, 10 months ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.129: +13 -4 lines
Diff to previous 1.129 (colored)

Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Oct 12 16:49:00 2013 UTC (9 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.128: +6 -6 lines
Diff to previous 1.128 (colored)

Pass the device name in, so we can debug what deferred drivers did not work.

Revision 1.127.4.1 / (download) - annotate - [select for diffs], Wed Aug 28 23:59:24 2013 UTC (9 years, 5 months ago) by rmind
Branch: rmind-smpnet
Changes since 1.127: +6 -3 lines
Diff to previous 1.127 (colored)

sync with head

Revision 1.128 / (download) - annotate - [select for diffs], Wed Aug 7 12:50:17 2013 UTC (9 years, 6 months ago) by blymn
Branch: MAIN
Changes since 1.127: +6 -3 lines
Diff to previous 1.127 (colored)

Make sure a channel has drives attached before resetting it otherwise
wdc_reset will panic the kernel due to a null derefrence of ch_drives.

Revision 1.125.2.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:20:16 2013 UTC (9 years, 7 months ago) by tls
Branch: tls-maxphys
Changes since 1.125.2.1: +16 -2 lines
Diff to previous 1.125.2.1 (colored) to branchpoint 1.125 (colored)

resync from head

Revision 1.127 / (download) - annotate - [select for diffs], Wed Apr 3 17:15:07 2013 UTC (9 years, 10 months ago) by bouyer
Branch: MAIN
CVS Tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900
Branch point for: rmind-smpnet
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.115.4.3 / (download) - annotate - [select for diffs], Wed Jan 16 05:33:14 2013 UTC (10 years ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.115.4.2: +6 -3 lines
Diff to previous 1.115.4.2 (colored) to branchpoint 1.115 (colored)

sync with (a bit old) head

Revision 1.125.2.1 / (download) - annotate - [select for diffs], Tue Nov 20 03:01:59 2012 UTC (10 years, 2 months ago) by tls
Branch: tls-maxphys
Changes since 1.125: +6 -3 lines
Diff to previous 1.125 (colored)

Resync to 2012-11-19 00:00:00 UTC

Revision 1.126 / (download) - annotate - [select for diffs], Thu Nov 1 13:46:52 2012 UTC (10 years, 3 months ago) by abs
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, 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.115.4.2 / (download) - annotate - [select for diffs], Tue Oct 30 17:20:52 2012 UTC (10 years, 3 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.115.4.1: +208 -93 lines
Diff to previous 1.115.4.1 (colored) to branchpoint 1.115 (colored)

sync with head

Revision 1.125 / (download) - annotate - [select for diffs], Sat Aug 4 21:21:09 2012 UTC (10 years, 6 months 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 (10 years, 6 months 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 (10 years, 6 months 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 (10 years, 6 months 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 (10 years, 6 months 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 (10 years, 6 months 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 years, 6 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 years, 6 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 years, 7 months 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.115.8.1 / (download) - annotate - [select for diffs], Sun Apr 29 23:04:48 2012 UTC (10 years, 9 months ago) by mrg
Branch: jmcneill-usbmp
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored) next main 1.116 (colored)

sync to latest -current.

Revision 1.115.4.1 / (download) - annotate - [select for diffs], Tue Apr 17 00:07:28 2012 UTC (10 years, 9 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.115: +4 -4 lines
Diff to previous 1.115 (colored)

sync with head

Revision 1.116 / (download) - annotate - [select for diffs], Fri Apr 6 02:52:00 2012 UTC (10 years, 10 months 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.113.2.1 / (download) - annotate - [select for diffs], Mon Jun 6 09:07:45 2011 UTC (11 years, 8 months ago) by jruoho
Branch: jruoho-x86intr
Changes since 1.113: +85 -37 lines
Diff to previous 1.113 (colored) next main 1.114 (colored)

Sync with HEAD.

Revision 1.112.2.3 / (download) - annotate - [select for diffs], Tue May 31 03:04:34 2011 UTC (11 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.112.2.2: +42 -1 lines
Diff to previous 1.112.2.2 (colored) to branchpoint 1.112 (colored) next main 1.113 (colored)

sync with head

Revision 1.115 / (download) - annotate - [select for diffs], Sat Apr 30 00:34:03 2011 UTC (11 years, 9 months 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-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, 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.112.2.2 / (download) - annotate - [select for diffs], Thu Apr 21 01:41:45 2011 UTC (11 years, 9 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.112.2.1: +43 -36 lines
Diff to previous 1.112.2.1 (colored) to branchpoint 1.112 (colored)

sync with head

Revision 1.114 / (download) - annotate - [select for diffs], Mon Apr 18 01:47:28 2011 UTC (11 years, 9 months 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.98.4.5 / (download) - annotate - [select for diffs], Wed Aug 11 22:53:18 2010 UTC (12 years, 5 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.98.4.4: +3 -3 lines
Diff to previous 1.98.4.4 (colored) to branchpoint 1.98 (colored) next main 1.99 (colored)

sync with head.

Revision 1.112.2.1 / (download) - annotate - [select for diffs], Sun May 30 05:17:18 2010 UTC (12 years, 8 months ago) by rmind
Branch: rmind-uvmplock
Changes since 1.112: +3 -3 lines
Diff to previous 1.112 (colored)

sync with head

Revision 1.111.2.1 / (download) - annotate - [select for diffs], Fri Apr 30 14:43:08 2010 UTC (12 years, 9 months ago) by uebayasi
Branch: uebayasi-xip
Changes since 1.111: +7 -7 lines
Diff to previous 1.111 (colored) next main 1.112 (colored)

Sync with HEAD.

Revision 1.113 / (download) - annotate - [select for diffs], Sun Mar 28 20:46:18 2010 UTC (12 years, 10 months 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.98.4.4 / (download) - annotate - [select for diffs], Thu Mar 11 15:03:24 2010 UTC (12 years, 10 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.98.4.3: +14 -85 lines
Diff to previous 1.98.4.3 (colored) to branchpoint 1.98 (colored)

sync with head

Revision 1.112 / (download) - annotate - [select for diffs], Wed Feb 24 22:37:56 2010 UTC (12 years, 11 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 (13 years 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 (13 years, 1 month 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 (13 years, 2 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 (13 years, 3 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.98.4.3 / (download) - annotate - [select for diffs], Wed Sep 16 13:37:46 2009 UTC (13 years, 4 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.98.4.2: +16 -4 lines
Diff to previous 1.98.4.2 (colored) to branchpoint 1.98 (colored)

sync with head

Revision 1.107 / (download) - annotate - [select for diffs], Sun Sep 13 18:45:10 2009 UTC (13 years, 4 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.98.4.2 / (download) - annotate - [select for diffs], Sat May 16 10:41:18 2009 UTC (13 years, 8 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.98.4.1: +3 -3 lines
Diff to previous 1.98.4.1 (colored) to branchpoint 1.98 (colored)

sync with head

Revision 1.102.4.1 / (download) - annotate - [select for diffs], Wed May 13 17:19:11 2009 UTC (13 years, 8 months ago) by jym
Branch: jym-xensuspend
Changes since 1.102: +26 -13 lines
Diff to previous 1.102 (colored) next main 1.103 (colored)

Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.

Revision 1.106 / (download) - annotate - [select for diffs], Tue May 12 12:10:29 2009 UTC (13 years, 8 months 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.98.4.1 / (download) - annotate - [select for diffs], Mon May 4 08:12:34 2009 UTC (13 years, 9 months ago) by yamt
Branch: yamt-nfs-mp
Changes since 1.98: +94 -39 lines
Diff to previous 1.98 (colored)

sync with head.

Revision 1.101.2.2 / (download) - annotate - [select for diffs], Tue Apr 28 07:35:20 2009 UTC (13 years, 9 months ago) by skrll
Branch: nick-hppapmap
Changes since 1.101.2.1: +25 -12 lines
Diff to previous 1.101.2.1 (colored) to branchpoint 1.101 (colored) next main 1.102 (colored)

Sync with HEAD.

Revision 1.105 / (download) - annotate - [select for diffs], Tue Apr 7 18:01:20 2009 UTC (13 years, 10 months 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 (13 years, 10 months 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 (13 years, 10 months 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.101.2.1 / (download) - annotate - [select for diffs], Mon Jan 19 13:17:52 2009 UTC (14 years ago) by skrll
Branch: nick-hppapmap
Changes since 1.101: +17 -5 lines
Diff to previous 1.101 (colored)

Sync with HEAD.

Revision 1.96.6.6 / (download) - annotate - [select for diffs], Sat Jan 17 13:28:52 2009 UTC (14 years ago) by mjf
Branch: mjf-devfs2
Changes since 1.96.6.5: +15 -3 lines
Diff to previous 1.96.6.5 (colored) to branchpoint 1.96 (colored) next main 1.97 (colored)

Sync with HEAD.

Revision 1.99.2.2 / (download) - annotate - [select for diffs], Sat Dec 13 01:14:12 2008 UTC (14 years, 1 month ago) by haad
Branch: haad-dm
Changes since 1.99.2.1: +17 -5 lines
Diff to previous 1.99.2.1 (colored) to branchpoint 1.99 (colored) next main 1.100 (colored)

Update haad-dm branch to haad-dm-base2.

Revision 1.101.4.1 / (download) - annotate - [select for diffs], Thu Nov 20 02:45:36 2008 UTC (14 years, 2 months ago) by snj
Branch: netbsd-5
CVS Tags: netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b
Changes since 1.101: +17 -5 lines
Diff to previous 1.101 (colored) next main 1.102 (colored)

Pull up following revision(s) (requested by bouyer in ticket #67):
	sys/dev/ic/wdc.c: revision 1.256
	sys/dev/ata/ata.c: revision 1.102
	sys/dev/scsipi/atapi_wdc.c: revision 1.109
	sys/dev/ata/atavar.h: revision 1.78
	sys/dev/ata/ata_wdc.c: revision 1.91
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.102 / (download) - annotate - [select for diffs], Sun Nov 16 19:31:21 2008 UTC (14 years, 2 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.99.2.1 / (download) - annotate - [select for diffs], Sun Oct 19 22:16:19 2008 UTC (14 years, 3 months ago) by haad
Branch: haad-dm
Changes since 1.99: +57 -27 lines
Diff to previous 1.99 (colored)

Sync with HEAD.

Revision 1.98.6.2 / (download) - annotate - [select for diffs], Fri Oct 10 22:30:58 2008 UTC (14 years, 3 months ago) by skrll
Branch: wrstuden-revivesa
Changes since 1.98.6.1: +57 -27 lines
Diff to previous 1.98.6.1 (colored) to branchpoint 1.98 (colored) next main 1.99 (colored)

Sync with HEAD.

Revision 1.96.6.5 / (download) - annotate - [select for diffs], Sun Oct 5 20:11:28 2008 UTC (14 years, 4 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.96.6.4: +55 -25 lines
Diff to previous 1.96.6.4 (colored) to branchpoint 1.96 (colored)

Sync with HEAD.

Revision 1.101 / (download) - annotate - [select for diffs], Thu Oct 2 21:05:17 2008 UTC (14 years, 4 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 (14 years, 4 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.96.6.4 / (download) - annotate - [select for diffs], Sun Jun 29 09:33:05 2008 UTC (14 years, 7 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.96.6.3: +7 -7 lines
Diff to previous 1.96.6.3 (colored) to branchpoint 1.96 (colored)

Sync with HEAD.

Revision 1.98.6.1 / (download) - annotate - [select for diffs], Mon Jun 23 04:30:58 2008 UTC (14 years, 7 months ago) by wrstuden
Branch: wrstuden-revivesa
Changes since 1.98: +7 -7 lines
Diff to previous 1.98 (colored)

Sync w/ -current. 34 merge conflicts to follow.

Revision 1.98.8.1 / (download) - annotate - [select for diffs], Wed Jun 18 16:33:03 2008 UTC (14 years, 7 months ago) by simonb
Branch: simonb-wapbl
Changes since 1.98: +7 -7 lines
Diff to previous 1.98 (colored) next main 1.99 (colored)

Sync with head.

Revision 1.98.2.1 / (download) - annotate - [select for diffs], Tue Jun 17 09:14:25 2008 UTC (14 years, 7 months ago) by yamt
Branch: yamt-pf42
Changes since 1.98: +7 -7 lines
Diff to previous 1.98 (colored) next main 1.99 (colored)

sync with head.

Revision 1.99 / (download) - annotate - [select for diffs], Thu Jun 12 21:46:35 2008 UTC (14 years, 7 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.96.6.3 / (download) - annotate - [select for diffs], Sun Apr 6 09:58:50 2008 UTC (14 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.96.6.2: +3 -3 lines
Diff to previous 1.96.6.2 (colored) to branchpoint 1.96 (colored)

- after some discussion with agc@ i agreed it would be a good idea to move
  device_unregister_* to device_deregister_* to be more like the pmf(9)
  functions, especially since a lot of the time the function calls are next
  to each other.

- add device_register_name() support for dk(4).

Revision 1.96.6.2 / (download) - annotate - [select for diffs], Sat Apr 5 23:33:21 2008 UTC (14 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.96.6.1: +13 -3 lines
Diff to previous 1.96.6.1 (colored) to branchpoint 1.96 (colored)

- add "file-system DEVFS" and "pseudo-device devfsctl" to conf/std seeing
  as these are always needed.

- convert many, many drivers over to the New Devfs World Order. For a
  list of device drivers yet to be converted see,
  http://www.netbsd.org/~mjf/devfs-todo.html.

- add a new device_unregister_all(device_t) function to remove all device
  names associated with a device_t, which saves us having to construct
  device names when the driver is detached.

- add a DEV_AUDIO type for devices.

Revision 1.96.6.1 / (download) - annotate - [select for diffs], Thu Apr 3 12:42:38 2008 UTC (14 years, 10 months ago) by mjf
Branch: mjf-devfs2
Changes since 1.96: +31 -26 lines
Diff to previous 1.96 (colored)

Sync with HEAD.

Revision 1.70.2.8 / (download) - annotate - [select for diffs], Mon Mar 24 09:38:46 2008 UTC (14 years, 10 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.7: +27 -22 lines
Diff to previous 1.70.2.7 (colored) next main 1.71 (colored)

sync with head.

Revision 1.96.2.1 / (download) - annotate - [select for diffs], Mon Mar 24 07:15:15 2008 UTC (14 years, 10 months ago) by keiichi
Branch: keiichi-mipv6
Changes since 1.96: +31 -26 lines
Diff to previous 1.96 (colored) next main 1.97 (colored)

sync with head.

Revision 1.90.8.3 / (download) - annotate - [select for diffs], Sun Mar 23 02:04:36 2008 UTC (14 years, 10 months ago) by matt
Branch: matt-armv6
Changes since 1.90.8.2: +92 -50 lines
Diff to previous 1.90.8.2 (colored) to branchpoint 1.90 (colored) next main 1.91 (colored)

sync with HEAD

Revision 1.98 / (download) - annotate - [select for diffs], Tue Mar 18 20:46:36 2008 UTC (14 years, 10 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.70.2.7 / (download) - annotate - [select for diffs], Mon Mar 17 09:14:37 2008 UTC (14 years, 10 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.6: +6 -6 lines
Diff to previous 1.70.2.6 (colored)

sync with head.

Revision 1.97 / (download) - annotate - [select for diffs], Fri Feb 29 06:38:28 2008 UTC (14 years, 11 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.91.2.1 / (download) - annotate - [select for diffs], Mon Feb 18 21:05:36 2008 UTC (14 years, 11 months ago) by mjf
Branch: mjf-devfs
Changes since 1.91: +74 -39 lines
Diff to previous 1.91 (colored) next main 1.92 (colored)

Sync with HEAD.

Revision 1.70.2.6 / (download) - annotate - [select for diffs], Mon Jan 21 09:42:36 2008 UTC (15 years ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.5: +125 -78 lines
Diff to previous 1.70.2.5 (colored)

sync with head

Revision 1.92.2.3 / (download) - annotate - [select for diffs], Thu Jan 10 23:44:14 2008 UTC (15 years ago) by bouyer
Branch: bouyer-xeni386
CVS Tags: bouyer-xeni386-merge1
Changes since 1.92.2.2: +69 -32 lines
Diff to previous 1.92.2.2 (colored) to branchpoint 1.92 (colored) next main 1.93 (colored)

Sync with HEAD

Revision 1.96 / (download) - annotate - [select for diffs], Thu Jan 10 07:48:22 2008 UTC (15 years, 1 month 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 (15 years, 1 month 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.90.8.2 / (download) - annotate - [select for diffs], Wed Jan 9 01:52:24 2008 UTC (15 years, 1 month ago) by matt
Branch: matt-armv6
Changes since 1.90.8.1: +56 -46 lines
Diff to previous 1.90.8.1 (colored) to branchpoint 1.90 (colored)

sync with HEAD

Revision 1.92.2.2 / (download) - annotate - [select for diffs], Tue Jan 8 22:10:57 2008 UTC (15 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.92.2.1: +1 -1 lines
Diff to previous 1.92.2.1 (colored) to branchpoint 1.92 (colored)

Sync with HEAD

Revision 1.94 / (download) - annotate - [select for diffs], Fri Jan 4 21:17:50 2008 UTC (15 years, 1 month 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.92.2.1 / (download) - annotate - [select for diffs], Wed Jan 2 21:53:54 2008 UTC (15 years, 1 month ago) by bouyer
Branch: bouyer-xeni386
Changes since 1.92: +24 -13 lines
Diff to previous 1.92 (colored)

Sync with HEAD

Revision 1.91.4.1 / (download) - annotate - [select for diffs], Wed Dec 26 19:46:03 2007 UTC (15 years, 1 month ago) by ad
Branch: vmlocking2
Changes since 1.91: +55 -45 lines
Diff to previous 1.91 (colored) next main 1.92 (colored)

Sync with head.

Revision 1.93 / (download) - annotate - [select for diffs], Thu Dec 20 20:12:01 2007 UTC (15 years, 1 month 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.91.6.1 / (download) - annotate - [select for diffs], Tue Dec 11 15:25:28 2007 UTC (15 years, 1 month ago) by yamt
Branch: yamt-kmem
Changes since 1.91: +33 -34 lines
Diff to previous 1.91 (colored) next main 1.92 (colored)

sync with head.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Dec 9 20:27:54 2007 UTC (15 years, 2 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.90.6.4 / (download) - annotate - [select for diffs], Sat Dec 8 16:21:06 2007 UTC (15 years, 2 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.90.6.3: +3 -3 lines
Diff to previous 1.90.6.3 (colored) to branchpoint 1.90 (colored) next main 1.91 (colored)

Rename pnp(9) -> pmf(9), as requested by many.

Revision 1.90.8.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:25:39 2007 UTC (15 years, 3 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored)

sync with HEAD

Revision 1.90.6.3 / (download) - annotate - [select for diffs], Tue Nov 6 14:27:14 2007 UTC (15 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.90.6.2: +33 -54 lines
Diff to previous 1.90.6.2 (colored) to branchpoint 1.90 (colored)

Refactor PNP API:
- Make suspend/resume directly a device functionality. It consists of
  three layers (class logic, device logic, bus logic), all of them being
  optional. This replaces D0/D3 transitions.
- device_is_active returns true if the device was not disabled and was
  not suspended (even partially), device_is_enabled returns true if the
  device was enabled.
- Change pnp_global_transition into pnp_system_suspend and
  pnp_system_resume. Before running any suspend/resume handlers, check
  that all currently attached devices support power management and bail
  out otherwise. The latter is not done for the shutdown/panic case.
- Make the former bus-specific generic network handlers a class handler.
- Make PNP message like volume up/down/toogle PNP events. Each device
  can register what events they are interested in and whether the handler
  should be global or not.
- Introduce device_active API for devices to mark themselve in use from
  either the system or the device. Use this to implement the idle handling
  for audio and input devices. This is intended to replace most ad-hoc
  watchdogs as well.
- Fix somes situations in which audio resume would lose mixer settings.
- Make USB host controllers better deal with suspend in the light of
  shared interrupts.
- Flush filesystem cache on suspend.
- Flush disk caches on suspend. Put ATA disks into standby on suspend as
  well.
- Adopt drivers to use the new PNP API.
- Fix a critical bug in the generic cardbus layer that made D0->D3
  break.
- Fix ral(4) to set if_stop.
- Convert cbb(4) to the new PNP API.
- Apply the PCI Express SCI fix on resume again.

Revision 1.70.2.5 / (download) - annotate - [select for diffs], Sat Oct 27 11:30:04 2007 UTC (15 years, 3 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.4: +4 -4 lines
Diff to previous 1.70.2.4 (colored)

sync with head.

Revision 1.90.6.2 / (download) - annotate - [select for diffs], Fri Oct 26 15:44:15 2007 UTC (15 years, 3 months ago) by joerg
Branch: jmcneill-pm
Changes since 1.90.6.1: +4 -4 lines
Diff to previous 1.90.6.1 (colored) to branchpoint 1.90 (colored)

Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.

Revision 1.90.12.1 / (download) - annotate - [select for diffs], Thu Oct 25 22:37:09 2007 UTC (15 years, 3 months ago) by bouyer
Branch: bouyer-xenamd64
Changes since 1.90: +4 -4 lines
Diff to previous 1.90 (colored) next main 1.91 (colored)

Sync with HEAD.

Revision 1.86.2.8 / (download) - annotate - [select for diffs], Tue Oct 23 20:06:53 2007 UTC (15 years, 3 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.7: +4 -4 lines
Diff to previous 1.86.2.7 (colored) next main 1.87 (colored)

Sync with head.

Revision 1.91 / (download) - annotate - [select for diffs], Fri Oct 19 11:59:36 2007 UTC (15 years, 3 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.70.2.4 / (download) - annotate - [select for diffs], Mon Sep 3 14:33:25 2007 UTC (15 years, 5 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.3: +48 -62 lines
Diff to previous 1.70.2.3 (colored)

sync with head.

Revision 1.90.6.1 / (download) - annotate - [select for diffs], Fri Aug 3 22:17:15 2007 UTC (15 years, 6 months ago) by jmcneill
Branch: jmcneill-pm
Changes since 1.90: +52 -32 lines
Diff to previous 1.90 (colored)

Pull in power management changes from private branch.

Revision 1.86.2.7 / (download) - annotate - [select for diffs], Sun Jul 15 15:52:41 2007 UTC (15 years, 6 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.6: +36 -36 lines
Diff to previous 1.86.2.6 (colored)

Sync with head.

Revision 1.87.2.1 / (download) - annotate - [select for diffs], Wed Jul 11 20:05:15 2007 UTC (15 years, 7 months ago) by mjf
Branch: mjf-ufs-trans
Changes since 1.87: +45 -60 lines
Diff to previous 1.87 (colored) next main 1.88 (colored)

Sync with head.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Jul 9 21:00:30 2007 UTC (15 years, 7 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.86.2.6 / (download) - annotate - [select for diffs], Sun Jul 1 21:47:42 2007 UTC (15 years, 7 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.5: +3 -3 lines
Diff to previous 1.86.2.5 (colored)

Adapt to callout API change.

Revision 1.89 / (download) - annotate - [select for diffs], Sun Jul 1 09:47:19 2007 UTC (15 years, 7 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.86.2.5 / (download) - annotate - [select for diffs], Sun May 13 17:36:22 2007 UTC (15 years, 8 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.4: +3 -3 lines
Diff to previous 1.86.2.4 (colored)

- Pass the error number and residual count to biodone(), and let it handle
  setting error indicators. Prepare to eliminate B_ERROR.
- Add a flag argument to brelse() to be set into the buf's flags, instead
  of doing it directly. Typically used to set B_INVAL.
- Add a "struct cpu_info *" argument to kthread_create(), to be used to
  create bound threads. Change "bool mpsafe" to "int flags".
- Allow exit of LWPs in the IDL state when (l != curlwp).
- More locking fixes & conversion to the new API.

Revision 1.86.2.4 / (download) - annotate - [select for diffs], Tue Apr 10 13:24:22 2007 UTC (15 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.3: +4 -6 lines
Diff to previous 1.86.2.3 (colored)

Sync with head.

Revision 1.86.2.3 / (download) - annotate - [select for diffs], Tue Apr 10 12:07:08 2007 UTC (15 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.2: +8 -21 lines
Diff to previous 1.86.2.2 (colored)

Nuke the deferred kthread creation stuff, as it's no longer needed.
Pointed out by thorpej@.

Revision 1.86.2.2 / (download) - annotate - [select for diffs], Mon Apr 9 22:09:54 2007 UTC (15 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.86.2.1: +4 -4 lines
Diff to previous 1.86.2.1 (colored)

- Add two new arguments to kthread_create1: pri_t pri, bool mpsafe.
- Fork kthreads off proc0 as new LWPs, not new processes.

Revision 1.85.2.2 / (download) - annotate - [select for diffs], Sat Mar 24 14:55:20 2007 UTC (15 years, 10 months ago) by yamt
Branch: yamt-idlelwp
Changes since 1.85.2.1: +6 -7 lines
Diff to previous 1.85.2.1 (colored) to branchpoint 1.85 (colored) next main 1.86 (colored)

sync with head.

Revision 1.87.4.1 / (download) - annotate - [select for diffs], Sun Mar 18 00:06:41 2007 UTC (15 years, 10 months ago) by reinoud
Branch: reinoud-bufcleanup
Changes since 1.87: +4 -6 lines
Diff to previous 1.87 (colored) next main 1.88 (colored)

First attempt to bring branch in sync with HEAD

Revision 1.88 / (download) - annotate - [select for diffs], Sat Mar 17 06:41:36 2007 UTC (15 years, 10 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.86.2.1 / (download) - annotate - [select for diffs], Tue Mar 13 16:50:22 2007 UTC (15 years, 10 months ago) by ad
Branch: vmlocking
Changes since 1.86: +4 -3 lines
Diff to previous 1.86 (colored)

Sync with head.

Revision 1.87 / (download) - annotate - [select for diffs], Mon Mar 12 18:18:30 2007 UTC (15 years, 10 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.85.2.1 / (download) - annotate - [select for diffs], Mon Mar 12 05:53:07 2007 UTC (15 years, 11 months ago) by rmind
Branch: yamt-idlelwp
Changes since 1.85: +3 -3 lines
Diff to previous 1.85 (colored)

Sync with HEAD.

Revision 1.86 / (download) - annotate - [select for diffs], Sun Mar 4 06:01:44 2007 UTC (15 years, 11 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.70.2.3 / (download) - annotate - [select for diffs], Mon Feb 26 09:09:58 2007 UTC (15 years, 11 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.2: +21 -21 lines
Diff to previous 1.70.2.2 (colored)

sync with head.

Revision 1.85 / (download) - annotate - [select for diffs], Fri Feb 9 21:55:27 2007 UTC (16 years 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.76.2.3 / (download) - annotate - [select for diffs], Tue Feb 6 13:11:47 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.76.2.2: +21 -21 lines
Diff to previous 1.76.2.2 (colored) to branchpoint 1.76 (colored) next main 1.77 (colored)

Quieten noisy boot messages.

Revision 1.76.2.2 / (download) - annotate - [select for diffs], Fri Jan 12 00:57:34 2007 UTC (16 years ago) by ad
Branch: newlock2
Changes since 1.76.2.1: +3 -3 lines
Diff to previous 1.76.2.1 (colored) to branchpoint 1.76 (colored)

Sync with head.

Revision 1.70.2.2 / (download) - annotate - [select for diffs], Sat Dec 30 20:47:54 2006 UTC (16 years, 1 month ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70.2.1: +131 -70 lines
Diff to previous 1.70.2.1 (colored)

sync with head.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Dec 25 18:36:05 2006 UTC (16 years, 1 month 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.76.4.2 / (download) - annotate - [select for diffs], Sun Dec 10 07:16:57 2006 UTC (16 years, 2 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.76.4.1: +10 -9 lines
Diff to previous 1.76.4.1 (colored) to branchpoint 1.76 (colored) next main 1.77 (colored)

sync with head.

Revision 1.76.2.1 / (download) - annotate - [select for diffs], Sat Nov 18 21:34:03 2006 UTC (16 years, 2 months ago) by ad
Branch: newlock2
Changes since 1.76: +111 -68 lines
Diff to previous 1.76 (colored)

Sync with head.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Nov 16 01:32:47 2006 UTC (16 years, 2 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 (16 years, 3 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.76.4.1 / (download) - annotate - [select for diffs], Sun Oct 22 06:05:32 2006 UTC (16 years, 3 months ago) by yamt
Branch: yamt-splraiseipl
Changes since 1.76: +112 -70 lines
Diff to previous 1.76 (colored)

sync with head

Revision 1.81 / (download) - annotate - [select for diffs], Sun Oct 15 00:00:00 2006 UTC (16 years, 3 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 (16 years, 3 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 (16 years, 3 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 (16 years, 4 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 (16 years, 4 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.73.6.3 / (download) - annotate - [select for diffs], Thu Sep 14 12:31:27 2006 UTC (16 years, 4 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.73.6.2: +21 -3 lines
Diff to previous 1.73.6.2 (colored) to branchpoint 1.73 (colored) next main 1.74 (colored)

sync with head.

Revision 1.73.2.1 / (download) - annotate - [select for diffs], Sat Sep 9 02:49:44 2006 UTC (16 years, 5 months ago) by rpaulo
Branch: rpaulo-netinet-merge-pcb
Changes since 1.73: +24 -6 lines
Diff to previous 1.73 (colored) next main 1.74 (colored)

sync with head

Revision 1.76 / (download) - annotate - [select for diffs], Thu Sep 7 12:34:42 2006 UTC (16 years, 5 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.73.6.2 / (download) - annotate - [select for diffs], Sun Sep 3 15:23:55 2006 UTC (16 years, 5 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.73.6.1: +3 -3 lines
Diff to previous 1.73.6.1 (colored) to branchpoint 1.73 (colored)

sync with head.

Revision 1.75 / (download) - annotate - [select for diffs], Sun Aug 27 23:50:53 2006 UTC (16 years, 5 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.70.2.1 / (download) - annotate - [select for diffs], Wed Jun 21 15:02:45 2006 UTC (16 years, 7 months ago) by yamt
Branch: yamt-lazymbuf
Changes since 1.70: +13 -12 lines
Diff to previous 1.70 (colored)

sync with head.

Revision 1.73.4.1 / (download) - annotate - [select for diffs], Sat Apr 22 11:38:51 2006 UTC (16 years, 9 months ago) by simonb
Branch: simonb-timecounters
CVS Tags: simonb-timcounters-final
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored) next main 1.74 (colored)

Sync with head.

Revision 1.73.8.1 / (download) - annotate - [select for diffs], Wed Apr 19 03:24:32 2006 UTC (16 years, 9 months ago) by elad
Branch: elad-kernelauth
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored) next main 1.74 (colored)

sync with head.

Revision 1.73.6.1 / (download) - annotate - [select for diffs], Sat Apr 1 12:06:54 2006 UTC (16 years, 10 months ago) by yamt
Branch: yamt-pdpolicy
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored)

sync with head.

Revision 1.73.10.1 / (download) - annotate - [select for diffs], Fri Mar 31 09:45:18 2006 UTC (16 years, 10 months ago) by tron
Branch: peter-altq
Changes since 1.73: +4 -4 lines
Diff to previous 1.73 (colored) next main 1.74 (colored)

Merge 2006-03-31 NetBSD-current into the "peter-altq" branch.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Mar 29 04:16:48 2006 UTC (16 years, 10 months 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.72.2.1 / (download) - annotate - [select for diffs], Wed Feb 1 14:52:08 2006 UTC (17 years ago) by yamt
Branch: yamt-uio_vmspace
Changes since 1.72: +4 -4 lines
Diff to previous 1.72 (colored) next main 1.73 (colored)

sync with head.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Jan 22 16:40:56 2006 UTC (17 years 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 (17 years, 1 month 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.18.2.10 / (download) - annotate - [select for diffs], Thu Nov 10 14:03:54 2005 UTC (17 years, 3 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.9: +46 -30 lines
Diff to previous 1.18.2.9 (colored) next main 1.19 (colored)

Sync with HEAD. Here we go again...

Revision 1.71 / (download) - annotate - [select for diffs], Thu Jul 7 17:51:31 2005 UTC (17 years, 7 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 (17 years, 8 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.66.2.2 / (download) - annotate - [select for diffs], Sat May 28 13:08:04 2005 UTC (17 years, 8 months ago) by tron
Branch: netbsd-3
CVS Tags: netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0
Changes since 1.66.2.1: +4 -5 lines
Diff to previous 1.66.2.1 (colored) to branchpoint 1.66 (colored) next main 1.67 (colored)

Pull up revision 1.69 (requested by bouyer in ticket #340):
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.66.2.1 / (download) - annotate - [select for diffs], Fri May 27 23:10:52 2005 UTC (17 years, 8 months ago) by riz
Branch: netbsd-3
Changes since 1.66: +34 -18 lines
Diff to previous 1.66 (colored)

Pull up revision 1.68 (requested by bouyer in ticket #328):
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.27.2.2 / (download) - annotate - [select for diffs], Tue May 24 19:54:47 2005 UTC (17 years, 8 months ago) by riz
Branch: netbsd-2-0
CVS Tags: netbsd-2-0-3-RELEASE
Changes since 1.27.2.1: +4 -6 lines
Diff to previous 1.27.2.1 (colored) to branchpoint 1.27 (colored) next main 1.28 (colored)

Pull up revision 1.69 via patch(requested by bouyer in ticket #1543):
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.27.2.1.2.1 / (download) - annotate - [select for diffs], Tue May 24 19:54:43 2005 UTC (17 years, 8 months ago) by riz
Branch: netbsd-2
CVS Tags: netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1
Changes since 1.27.2.1: +4 -6 lines
Diff to previous 1.27.2.1 (colored) next main 1.27.2.2 (colored)

Pull up revision 1.69 via patch(requested by bouyer in ticket #1543):
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.69 / (download) - annotate - [select for diffs], Fri May 20 14:39:04 2005 UTC (17 years, 8 months 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 (17 years, 8 months 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.63.4.1 / (download) - annotate - [select for diffs], Fri Apr 29 11:28:45 2005 UTC (17 years, 9 months ago) by kent
Branch: kent-audio2
Changes since 1.63: +72 -26 lines
Diff to previous 1.63 (colored) next main 1.64 (colored)

sync with -current

Revision 1.67 / (download) - annotate - [select for diffs], Mon Apr 11 04:24:54 2005 UTC (17 years, 10 months 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.63.6.2 / (download) - annotate - [select for diffs], Sat Mar 19 08:33:55 2005 UTC (17 years, 10 months ago) by yamt
Branch: yamt-km
Changes since 1.63.6.1: +26 -22 lines
Diff to previous 1.63.6.1 (colored) to branchpoint 1.63 (colored) next main 1.64 (colored)

sync with head.  xen and whitespace.  xen part is not finished.

Revision 1.18.2.9 / (download) - annotate - [select for diffs], Fri Mar 4 16:41:02 2005 UTC (17 years, 11 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.8: +26 -22 lines
Diff to previous 1.18.2.8 (colored)

Sync with HEAD.

Hi Perry!

Revision 1.66 / (download) - annotate - [select for diffs], Fri Mar 4 11:00:54 2005 UTC (17 years, 11 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 (17 years, 11 months ago) by perry
Branch: MAIN
Changes since 1.64: +22 -22 lines
Diff to previous 1.64 (colored)

nuke trailing whitespace

Revision 1.63.6.1 / (download) - annotate - [select for diffs], Sat Feb 12 18:17:42 2005 UTC (17 years, 11 months ago) by yamt
Branch: yamt-km
Changes since 1.63: +45 -3 lines
Diff to previous 1.63 (colored)

sync with head.

Revision 1.18.2.8 / (download) - annotate - [select for diffs], Fri Feb 4 11:45:22 2005 UTC (18 years ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.7: +45 -3 lines
Diff to previous 1.18.2.7 (colored)

Sync with HEAD.

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

Add powerhook for atabus.

Revision 1.18.2.7 / (download) - annotate - [select for diffs], Mon Nov 29 07:24:06 2004 UTC (18 years, 2 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.6: +3 -3 lines
Diff to previous 1.18.2.6 (colored)

Sync with HEAD.

Revision 1.63 / (download) - annotate - [select for diffs], Sun Nov 14 15:25:11 2004 UTC (18 years, 2 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.18.2.6 / (download) - annotate - [select for diffs], Tue Nov 2 07:51:19 2004 UTC (18 years, 3 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.5: +37 -3 lines
Diff to previous 1.18.2.5 (colored)

Sync with HEAD.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Oct 30 23:10:37 2004 UTC (18 years, 3 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 (18 years, 3 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.18.2.5 / (download) - annotate - [select for diffs], Tue Sep 21 13:27:23 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.4: +5 -5 lines
Diff to previous 1.18.2.4 (colored)

Fix the sync with head I botched.

Revision 1.18.2.4 / (download) - annotate - [select for diffs], Sat Sep 18 14:45:25 2004 UTC (18 years, 4 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.3: +6 -5 lines
Diff to previous 1.18.2.3 (colored)

Sync with HEAD.

Revision 1.60 / (download) - annotate - [select for diffs], Sat Sep 11 18:01:58 2004 UTC (18 years, 4 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.18.2.3 / (download) - annotate - [select for diffs], Wed Aug 25 06:57:34 2004 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.2: +814 -71 lines
Diff to previous 1.18.2.2 (colored)

Sync with HEAD.

Revision 1.59 / (download) - annotate - [select for diffs], Sat Aug 21 00:48:32 2004 UTC (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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 (18 years, 5 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.18.2.2 / (download) - annotate - [select for diffs], Thu Aug 12 11:41:22 2004 UTC (18 years, 5 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18.2.1: +81 -35 lines
Diff to previous 1.18.2.1 (colored)

Sync with HEAD.

Revision 1.37 / (download) - annotate - [select for diffs], Thu Aug 12 05:02:50 2004 UTC (18 years, 5 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 (18 years, 5 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 (18 years, 6 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 (18 years, 6 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 (18 years, 6 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 (18 years, 6 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.18.2.1 / (download) - annotate - [select for diffs], Tue Aug 3 10:45:46 2004 UTC (18 years, 6 months ago) by skrll
Branch: ktrace-lwp
Changes since 1.18: +402 -25 lines
Diff to previous 1.18 (colored)

Sync with HEAD

Revision 1.31 / (download) - annotate - [select for diffs], Mon Aug 2 22:02:35 2004 UTC (18 years, 6 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 (18 years, 6 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 (18 years, 8 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.27.2.1 / (download) - annotate - [select for diffs], Sun Apr 18 02:23:45 2004 UTC (18 years, 9 months ago) by jmc
Branch: netbsd-2-0
CVS Tags: netbsd-2-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE
Branch point for: netbsd-2
Changes since 1.27: +4 -4 lines
Diff to previous 1.27 (colored)

Pullup rev 1.28 (requested by bouyer in ticket #149)

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.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Apr 13 19:51:06 2004 UTC (18 years, 9 months 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 (19 years, 1 month 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 (19 years, 1 month 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 (19 years, 1 month 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 (19 years, 1 month 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 (19 years, 1 month 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 (19 years, 1 month 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 (19 years, 1 month 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 (19 years, 4 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 (19 years, 4 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.17.4.1 / (download) - annotate - [select for diffs], Mon Jun 30 02:53:47 2003 UTC (19 years, 7 months ago) by grant
Branch: netbsd-1-6
CVS Tags: netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored) next main 1.18 (colored)

Pull up revision 1.18 (requested by bouyer in ticket #1353):

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.18 / (download) - annotate - [select for diffs], Mon Jan 27 21:27:52 2003 UTC (20 years 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.13.4.1 / (download) - annotate - [select for diffs], Thu Jan 23 08:11:28 2003 UTC (20 years ago) by msaitoh
Branch: netbsd-1-5
Changes since 1.13: +4 -1 lines
Diff to previous 1.13 (colored) next main 1.14 (colored)

Pull up revision 1.17 (requested by Manuel Bouyer):

 read status after data commands in wdc_exec_command(). Mandatory for data out
 commands (nonw are used for now), and doesn't hurt for data in. Also keep
 track if we did transfer data. Makes the probe more robust and solves
 kern/16159

Revision 1.13.8.2 / (download) - annotate - [select for diffs], Sun Jun 23 17:45:52 2002 UTC (20 years, 7 months ago) by jdolecek
Branch: kqueue
Changes since 1.13.8.1: +5 -2 lines
Diff to previous 1.13.8.1 (colored) to branchpoint 1.13 (colored) next main 1.14 (colored)

catch up with -current on kqueue branch

Revision 1.13.6.3 / (download) - annotate - [select for diffs], Wed Apr 17 00:05:24 2002 UTC (20 years, 9 months ago) by nathanw
Branch: nathanw_sa
CVS Tags: nathanw_sa_end
Changes since 1.13.6.2: +5 -2 lines
Diff to previous 1.13.6.2 (colored) to branchpoint 1.13 (colored) next main 1.14 (colored)

Catch up to -current.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Apr 9 21:17:53 2002 UTC (20 years, 10 months 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.13.8.1 / (download) - annotate - [select for diffs], Thu Jan 10 19:53:39 2002 UTC (21 years, 1 month ago) by thorpej
Branch: kqueue
Changes since 1.13: +10 -38 lines
Diff to previous 1.13 (colored)

Sync kqueue branch with -current.

Revision 1.13.6.2 / (download) - annotate - [select for diffs], Tue Jan 8 00:29:21 2002 UTC (21 years, 1 month ago) by nathanw
Branch: nathanw_sa
Changes since 1.13.6.1: +8 -39 lines
Diff to previous 1.13.6.1 (colored) to branchpoint 1.13 (colored)

Catch up to -current.

Revision 1.16 / (download) - annotate - [select for diffs], Mon Dec 3 00:20:22 2001 UTC (21 years, 2 months ago) by bouyer
Branch: MAIN
CVS Tags: newlock-base, newlock, ifpoll-base, 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 (21 years, 2 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.13.6.1 / (download) - annotate - [select for diffs], Wed Nov 14 19:13:59 2001 UTC (21 years, 2 months ago) by nathanw
Branch: nathanw_sa
Changes since 1.13: +4 -1 lines
Diff to previous 1.13 (colored)

Catch up to -current.

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

add RCSID

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Mon Nov 20 11:39:50 2000 UTC (22 years, 2 months ago) by bouyer
Branch: thorpej_scsipi
Changes since 1.9: +37 -6 lines
Diff to previous 1.9 (colored) next main 1.10 (colored)

Update thorpej_scsipi to -current as of a month ago
A i386 GENERIC kernel compiles without the siop, ahc and bha drivers
(will be updated later). i386 IDE/ATAPI and ncr work, as well as
sparc/esp_sbus. alpha should work as well (untested yet).
siop, ahc and bha will be updated once I've updated the branch to current
-current, as well as machine-dependant code.

Revision 1.7.2.3 / (download) - annotate - [select for diffs], Fri Jul 7 17:33:46 2000 UTC (22 years, 7 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003
Changes since 1.7.2.2: +13 -6 lines
Diff to previous 1.7.2.2 (colored) to branchpoint 1.7 (colored) next main 1.8 (colored)

Apply patch (requested by bouyer):
  Add support for the following PCIIDE controllers:
   o AMD 756
   o CMD PCI0648 and PCI0649
   o Hightpoint HPT366
   o OPTi 82c621 (and a few of its derivatives)
   o Promise Ultra/33 and Ultra/66
   o Intel 82801 (ICH/ICH0)
  Also fix PR#10437 (detect more ATAPI devices).

Revision 1.13 / (download) - annotate - [select for diffs], Mon May 15 08:31:33 2000 UTC (22 years, 8 months 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 (23 years 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.7.2.2 / (download) - annotate - [select for diffs], Sun Jan 23 12:25:32 2000 UTC (23 years ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH002
Changes since 1.7.2.1: +25 -1 lines
Diff to previous 1.7.2.1 (colored) to branchpoint 1.7 (colored)

Pull up revision 1.11 (requested by bouyer):
  Improve the downgrade logic to work better in some cases (especially
  for Acer Labs M5229 controllers with Ultra-DMA/66 disks).

Revision 1.11 / (download) - annotate - [select for diffs], Mon Jan 17 00:01:00 2000 UTC (23 years 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.9.8.2 / (download) - annotate - [select for diffs], Mon Dec 27 18:34:35 1999 UTC (23 years, 1 month ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.9.8.1: +9 -2 lines
Diff to previous 1.9.8.1 (colored) to branchpoint 1.9 (colored) next main 1.10 (colored)

Pull up to last week's -current.

Revision 1.9.8.1 / (download) - annotate - [select for diffs], Tue Dec 21 23:19:52 1999 UTC (23 years, 1 month ago) by wrstuden
Branch: wrstuden-devbsize
Changes since 1.9: +4 -4 lines
Diff to previous 1.9 (colored)

Initial commit of recent changes to make DEV_BSIZE go away.

Runs on i386, needs work on other arch's. Main kernel routines should be
fine, but a number of the stand programs need help.

cd, fd, ccd, wd, and sd have been updated. sd has been tested with non-512
byte block devices. vnd, raidframe, and lfs need work.

Non 2**n block support is automatic for LKM's and conditional for kernels
on "options NON_PO2_BLOCKS".

Revision 1.10 / (download) - annotate - [select for diffs], Fri Nov 26 12:39:43 1999 UTC (23 years, 2 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.7.2.1.2.1 / (download) - annotate - [select for diffs], Mon Jun 21 01:17:38 1999 UTC (23 years, 7 months ago) by thorpej
Branch: chs-ubc2
Changes since 1.7.2.1: +0 -0 lines
Diff to previous 1.7.2.1 (colored) next main 1.7.2.2 (colored)

Sync w/ -current.

Revision 1.7.2.1 / (download) - annotate - [select for diffs], Tue Apr 20 00:54:40 1999 UTC (23 years, 9 months ago) by cjs
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-RELEASE, netbsd-1-4-PATCH001, kame_14_19990705, kame_14_19990628, kame_141_19991130, kame
Branch point for: chs-ubc2
Changes since 1.7: +3 -2 lines
Diff to previous 1.7 (colored)

Pull up to HEAD 1.9, per Manuel Bouyer <bouyer@antioche.eu.org>

Revision 1.9 / (download) - annotate - [select for diffs], Thu Apr 15 09:41:09 1999 UTC (23 years, 9 months 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 (23 years, 9 months 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 (23 years, 11 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 (23 years, 11 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 (24 years 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 (24 years 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 (24 years, 2 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 (24 years, 4 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.2.4 / (download) - annotate - [select for diffs], Sun Sep 20 13:16:15 1998 UTC (24 years, 4 months ago) by bouyer
Branch: bouyer-ide
CVS Tags: bouyer-ide-merge
Changes since 1.1.2.3: +2 -2 lines
Diff to previous 1.1.2.3 (colored) to branchpoint 1.1 (colored) next main 1.2 (colored)

- always call config_found() from wdcattach(), instead of printing our own
  the "not configured" message ourselve. When no atapibus is configured,
  use a fake ata_atapi_attach, else call wdc_atapibus_attach(). This way we
  don't have to include the whole atapi support in an ata-only config.
- the dma_* function pointers take a 'int flags' as last argument, instead
  of an 'int read'. The 2 valid flags are: WDC_DMA_READ (to select read/write)
  and WDC_DMA_POLL, to signal interrupt-less mode (for core dumps).
- Reworked wdcprobe() so look more like the old one. A status of 0xff is
  interpreted as "no drive" (freebsd does this); this this speed up
  the probe for non-IDE machines (a reset timeout has been bumped to 31s,
  to match the specs). The probe set ups the drive flags to either ATA or
  ATAPI (depend on register signature) or OLD (if register signature don't
  match, but a working drive appears to be there). Later the ATA code
  will look at the OLD flag to decide wether there is no drive, or an old
  (ST506) one if WDC_IDENTIFY fails.
- For known PCI chips, don't use the wdcprobe() heuristic to find wether
  a channel is enabled/disabled; use the chip's specific registers for this.
- Clear the command queue when we have a polled command. This allows dumps to
  work even if a command was being handled by the controller at panic time.
- Increase the number of available DMA segments by one, as user requests may
  not be aligned on a page boundary.

Revision 1.1.2.3 / (download) - annotate - [select for diffs], Thu Aug 13 14:27:47 1998 UTC (24 years, 5 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.1.2.2: +10 -8 lines
Diff to previous 1.1.2.2 (colored) to branchpoint 1.1 (colored)

 - sync with HEAD
 - better error detection and report for wd drives
 - better wddump() support
 - wdcwait() now takes a timout argument, so that we can honnor the
   timeout argument of scsipi cmds.

Revision 1.1.2.2 / (download) - annotate - [select for diffs], Fri Jun 5 08:38:57 1998 UTC (24 years, 8 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.1.2.1: +5 -2 lines
Diff to previous 1.1.2.1 (colored) to branchpoint 1.1 (colored)

Patches from Leo Weppelman for IDE on atari, with minor fixes by me
(needed the addition of a void wdcrestart __P((void*)) function).
Quoting his words:
These diffs are preliminary because it looks like the free_hw() function
does not get called. This is only a problem on the atari falcon. I have not
yet been able to track this down.
Also, KNF wdc.c.

Revision 1.1.2.1 / (download) - annotate - [select for diffs], Thu Jun 4 16:52:34 1998 UTC (24 years, 8 months ago) by bouyer
Branch: bouyer-ide
Changes since 1.1: +146 -0 lines
Diff to previous 1.1 (colored)

Commit changes to the IDE system in a branch. This allows a better separation
between higth-level and low-level (i.e. registers read/write) and generalize
the queue for all commands. This also add supports for IDE DMA.

Revision 1.1, Thu Jun 4 16:52:33 1998 UTC (24 years, 8 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>