The NetBSD Project

CVS log for src/sys/dev/ic/siisata.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.51: download - view: text, markup, annotated - select for diffs
Fri Feb 2 22:00:33 2024 UTC (14 months, 3 weeks ago) by andvar
Branches: MAIN
CVS tags: perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, HEAD
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +3 -3 lines
fix various typos in comments.

Revision 1.39.4.1: download - view: text, markup, annotated - select for diffs
Fri Dec 30 14:39:09 2022 UTC (2 years, 3 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.39: preferred, colored; next MAIN 1.40: preferred, colored
Changes since revision 1.39: +20 -36 lines
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.50: download - view: text, markup, annotated - select for diffs
Wed Nov 10 17:19:30 2021 UTC (3 years, 5 months ago) by msaitoh
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, netbsd-10-base, netbsd-10-1-RELEASE, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +3 -3 lines
s/endianess/endianness/

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue Oct 5 08:01:05 2021 UTC (3 years, 6 months ago) by rin
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +14 -8 lines
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.48: download - view: text, markup, annotated - select for diffs
Sat Aug 7 16:19:12 2021 UTC (3 years, 8 months ago) by thorpej
Branches: MAIN
CVS tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +3 -4 lines
Merge thorpej-cfargs2.

Revision 1.47.8.1: download - view: text, markup, annotated - select for diffs
Wed Aug 4 20:14:42 2021 UTC (3 years, 8 months ago) by thorpej
Branches: thorpej-cfargs2
Diff to: previous 1.47: preferred, colored; next MAIN 1.48: preferred, colored
Changes since revision 1.47: +3 -4 lines
Adapt to CFARGS().

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sat Apr 24 23:36:55 2021 UTC (4 years ago) by thorpej
Branches: 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
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +5 -4 lines
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.43.2.2: download - view: text, markup, annotated - select for diffs
Sat Apr 3 22:28:45 2021 UTC (4 years ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.43.2.1: preferred, colored; next MAIN 1.44: preferred, colored
Changes since revision 1.43.2.1: +5 -5 lines
Sync with HEAD.

Revision 1.46.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 2 22:17:44 2021 UTC (4 years ago) by thorpej
Branches: thorpej-cfargs
Diff to: previous 1.46: preferred, colored; next MAIN 1.47: preferred, colored
Changes since revision 1.46: +5 -4 lines
config_found_ia() -> config_found() w/ CFARG_IATTR.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Mon Jan 11 16:48:35 2021 UTC (4 years, 3 months ago) by skrll
Branches: MAIN
CVS tags: thorpej-futex-base, thorpej-cfargs-base
Branch point for: thorpej-cfargs
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -3 lines
KNF

Revision 1.45: download - view: text, markup, annotated - select for diffs
Mon Jan 11 16:48:03 2021 UTC (4 years, 3 months ago) by skrll
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +4 -4 lines
Trailing whitespace

Revision 1.43.2.1: download - view: text, markup, annotated - select for diffs
Sun Jan 3 16:34:58 2021 UTC (4 years, 3 months ago) by thorpej
Branches: thorpej-futex
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +12 -12 lines
Sync w/ HEAD.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Fri Dec 25 12:33:03 2020 UTC (4 years, 4 months ago) by skrll
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +12 -12 lines
Use designated initializers for struct ata_bustype

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sat Oct 10 20:27:54 2020 UTC (4 years, 6 months ago) by thorpej
Branches: MAIN
Branch point for: thorpej-futex
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +5 -6 lines
In siisata_intr_port(), skip reading the error condition if
ata_queue_get_active_xfer() returns NULL.

PR kern/55682.  Fix suggested by mlelstv@.

Revision 1.35.4.4: download - view: text, markup, annotated - select for diffs
Tue Apr 21 18:42:16 2020 UTC (5 years ago) by martin
Branches: phil-wifi
Diff to: previous 1.35.4.3: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.4.3: +6 -28 lines
Sync with HEAD

Revision 1.41.4.1: download - view: text, markup, annotated - select for diffs
Mon Apr 20 11:29:03 2020 UTC (5 years ago) by bouyer
Branches: bouyer-xenpvh
Diff to: previous 1.41: preferred, colored; next MAIN 1.42: preferred, colored
Changes since revision 1.41: +8 -30 lines
Sync with HEAD

Revision 1.42: download - view: text, markup, annotated - select for diffs
Mon Apr 13 10:49:34 2020 UTC (5 years ago) by jdolecek
Branches: MAIN
CVS tags: phil-wifi-20200421, bouyer-xenpvh-base2, bouyer-xenpvh-base1
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +8 -30 lines
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.35.4.3: download - view: text, markup, annotated - select for diffs
Mon Apr 13 08:04:22 2020 UTC (5 years ago) by martin
Branches: phil-wifi
Diff to: previous 1.35.4.2: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.4.2: +1 -8 lines
Mostly merge changes from HEAD upto 20200411

Revision 1.35.4.2: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:06 2020 UTC (5 years ago) by martin
Branches: phil-wifi
Diff to: previous 1.35.4.1: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.4.1: +8 -8 lines
Merge changes from current as of 20200406

Revision 1.40.2.1: download - view: text, markup, annotated - select for diffs
Sat Feb 29 20:19:08 2020 UTC (5 years, 1 month ago) by ad
Branches: ad-namecache
Diff to: previous 1.40: preferred, colored; next MAIN 1.41: preferred, colored
Changes since revision 1.40: +8 -8 lines
Sync with head.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Wed Feb 19 16:04:39 2020 UTC (5 years, 2 months ago) by riastradh
Branches: MAIN
CVS tags: phil-wifi-20200411, phil-wifi-20200406, is-mlppp-base, is-mlppp, bouyer-xenpvh-base, ad-namecache-base3
Branch point for: bouyer-xenpvh
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +8 -8 lines
C99 initializers for scsipi_bustype.  No functional change intended.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sun Nov 10 21:16:35 2019 UTC (5 years, 5 months ago) by chs
Branches: MAIN
CVS tags: phil-wifi-20191119, ad-namecache-base2, ad-namecache-base1, ad-namecache-base
Branch point for: ad-namecache
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -10 lines
in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.

Revision 1.35.4.1: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:07:11 2019 UTC (5 years, 10 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +170 -225 lines
Sync with HEAD

Revision 1.35.2.1: download - view: text, markup, annotated - select for diffs
Mon Nov 26 01:52:31 2018 UTC (6 years, 5 months ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35: +170 -225 lines
Sync with HEAD, resolve a couple of conflicts

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Nov 19 19:52:08 2018 UTC (6 years, 5 months ago) by jdolecek
Branches: MAIN
CVS tags: phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, isaki-audio2-base, isaki-audio2
Branch point for: netbsd-9
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +5 -5 lines
consistently use the SATA correct 'port %d' instead of 'channel', some
whitespace fixes

Revision 1.38: download - view: text, markup, annotated - select for diffs
Wed Oct 24 20:07:37 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +4 -2 lines
need now channel lock around siisata_device_reset() executed for fatal error

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Oct 24 19:38:00 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +26 -10 lines
detach the controller itself on shutdown; adjust to not detach already
detached atabus/channel

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Oct 22 20:13:47 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +141 -214 lines
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.35.6.11: download - view: text, markup, annotated - select for diffs
Sun Oct 21 18:13:14 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.10: preferred, colored; branchpoint 1.35: preferred, colored; next MAIN 1.36: preferred, colored
Changes since revision 1.35.6.10: +33 -20 lines
decouple siisata_reset_channel() from siisata_reinit_port(); the former
now needs channel lock, but we don't have it in siisata_init_port()
during attach

instead call siisata_reset_channel() when siisata_reinit_port() fails,
and ignore the error during attach

Revision 1.35.6.10: download - view: text, markup, annotated - select for diffs
Mon Oct 15 21:18:53 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.9: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.9: +13 -19 lines
change the SATA/NCQ recovery to run in the atabus thread

Revision 1.35.6.9: download - view: text, markup, annotated - select for diffs
Thu Oct 11 20:57:51 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.8: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.8: +17 -107 lines
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.35.6.8: download - view: text, markup, annotated - select for diffs
Sun Oct 7 15:42:47 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.7: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.7: +5 -2 lines
call atastart() when ATA command completes without timeout or error, similar
to AHCI

Revision 1.35.6.7: download - view: text, markup, annotated - select for diffs
Thu Oct 4 17:59:35 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.6: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.6: +8 -4 lines
further channel locking pass for reset

Revision 1.35.6.6: download - view: text, markup, annotated - select for diffs
Wed Oct 3 19:20:48 2018 UTC (6 years, 6 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.5: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.5: +7 -9 lines
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.35.6.5: download - view: text, markup, annotated - select for diffs
Sat Sep 22 09:22:59 2018 UTC (6 years, 7 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.4: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.4: +38 -29 lines
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.35.6.4: download - view: text, markup, annotated - select for diffs
Mon Sep 17 19:30:26 2018 UTC (6 years, 7 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.3: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.3: +4 -4 lines
move ATAPI-only members of ata_xfer to an union struct to further save space

Revision 1.35.6.3: download - view: text, markup, annotated - select for diffs
Mon Sep 17 18:36:14 2018 UTC (6 years, 7 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.2: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.2: +34 -22 lines
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.35.6.2: download - view: text, markup, annotated - select for diffs
Sat Sep 1 10:13:41 2018 UTC (6 years, 7 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35.6.1: preferred, colored; branchpoint 1.35: preferred, colored
Changes since revision 1.35.6.1: +11 -11 lines
only call ata_deactivate_xfer() once completely done with the active
xfer in controller code (i.e. after bus_dmamap_sync() et.al.), so that
the command slot is safe to be reused immediatelly after deactivate

Revision 1.35.6.1: download - view: text, markup, annotated - select for diffs
Fri Aug 31 19:08:03 2018 UTC (6 years, 7 months ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +13 -29 lines
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.22.2.4: download - view: text, markup, annotated - select for diffs
Sun Dec 3 11:37:04 2017 UTC (7 years, 4 months ago) by jdolecek
Branches: tls-maxphys
Diff to: previous 1.22.2.3: preferred, colored; next MAIN 1.23: preferred, colored
Changes since revision 1.22.2.3: +692 -394 lines
update from HEAD

Revision 1.35: download - view: text, markup, annotated - select for diffs
Fri Oct 20 07:06:07 2017 UTC (7 years, 6 months ago) by jdolecek
Branches: 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
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +2 -4 lines
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.34: download - view: text, markup, annotated - select for diffs
Sat Oct 7 16:05:32 2017 UTC (7 years, 6 months ago) by jdolecek
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +643 -342 lines
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.30.4.38: download - view: text, markup, annotated - select for diffs
Tue Sep 19 21:06:25 2017 UTC (7 years, 7 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.37: preferred, colored; branchpoint 1.30: preferred, colored; next MAIN 1.31: preferred, colored
Changes since revision 1.30.4.37: +25 -12 lines
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.30.4.37: download - view: text, markup, annotated - select for diffs
Sun Sep 10 19:31:15 2017 UTC (7 years, 7 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.36: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.36: +90 -41 lines
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.27.6.4: download - view: text, markup, annotated - select for diffs
Mon Aug 28 17:52:03 2017 UTC (7 years, 8 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.27.6.3: preferred, colored; branchpoint 1.27: preferred, colored; next MAIN 1.28: preferred, colored
Changes since revision 1.27.6.3: +52 -58 lines
Sync with HEAD

Revision 1.30.4.36: download - view: text, markup, annotated - select for diffs
Tue Aug 15 20:12:28 2017 UTC (7 years, 8 months ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.35: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.35: +4 -3 lines
Use ata_queue_free() instead of free() to deallocate chp->ch_queue during detach.

Revision 1.30.4.35: download - view: text, markup, annotated - select for diffs
Sat Aug 12 22:12:04 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.34: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.34: +3 -2 lines
do not reset drive after successful NCQ error recovery

Revision 1.30.4.34: download - view: text, markup, annotated - select for diffs
Fri Aug 11 18:20:13 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.33: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.33: +11 -6 lines
replace magic 3100 with locall defined WDC_RESET_WAIT

Revision 1.30.4.33: download - view: text, markup, annotated - select for diffs
Fri Aug 4 20:53:46 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.32: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.32: +5 -5 lines
prb_control need to add (or) PRB_CF_INTERRUPT_MASK for polled commands,
rather that set - the field may be nonzero for ATAPI or for protocol override

Revision 1.30.4.32: download - view: text, markup, annotated - select for diffs
Fri Aug 4 20:49:24 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.31: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.31: +19 -15 lines
restore part of what was removed in 1.30.4.30 - the success of command
needs to be driven by PSS so that it works also for polled commands, apparently
PR_PIS_CMDCMPL is not set in that case; now do error handling again only when
PSS_ATTENTION is set

this fixes timeout for polled commands like standby on shutdown,
and (ehm ehm), READ LOG EXT on NCQ error recovery

Revision 1.30.4.31: download - view: text, markup, annotated - select for diffs
Tue Aug 1 22:02:32 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.30: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.30: +8 -3 lines
fix logic bug in processing of finished commands - mask of active
commands can change during the loop as c_intr() callback can queue
new commands, so the interrupt routine should only mark as finished
those which were actually active before the loop started; otherwise
the code marked as finished commands which were just started, and
being executed by HBA, leading to all sorts of data corruption

while here mark the active mask volatile, as it is modified from
interrupt context

this fixes for good the random crashes, short reads, and fatal command
errors which I've been tracing down for past couple weeks

thanks to Jonathan (jakllsch@) for testing, and a script to easily
triggered the condition, and led to this bug being finally found and squashed

Revision 1.30.4.30: download - view: text, markup, annotated - select for diffs
Tue Aug 1 21:43:49 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.29: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.29: +51 -52 lines
adjust code to be closer to HEAD to it's easier to compare and find
regressions, undoing some changes which were actually not necessary

Revision 1.30.4.29: download - view: text, markup, annotated - select for diffs
Sun Jul 30 20:46:31 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.28: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.28: +3 -3 lines
undo debug code

Revision 1.30.4.28: download - view: text, markup, annotated - select for diffs
Sun Jul 30 20:24:45 2017 UTC (7 years, 8 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.27: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.27: +185 -135 lines
adjust error recovery to similar shape as ahcisata; also switch to using
siisata_reset_channel(), as that seems more reliably get the HBA to running
state again after some errors

besides this, change several places checking PORT_READY to use
siisata_reinit_port() and properly timeout - seen several cases
where it would just loop there indefinitely on some errors with no
way to get into ddb and no error message, due to the tight DELAY() loop

Revision 1.30.4.27: download - view: text, markup, annotated - select for diffs
Wed Jul 19 20:24:59 2017 UTC (7 years, 9 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.26: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.26: +2 -2 lines
forced commit to get into history - previous commit removed also
the siisata-specific downgrade of SATA channel speed on CRC, as it
doesn't really fit with error/state not being available after
c_intr(); as noted this handling should be in generic code, and
it's overly harsh to do this after single error anyway, particularly
since there is no way to get back

Revision 1.30.4.26: download - view: text, markup, annotated - select for diffs
Wed Jul 19 20:02:40 2017 UTC (7 years, 9 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.25: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.25: +211 -128 lines
convert over to new error handling world order:
- switch to ata_timeout()
- stop using ch_status/ch_error for passing state/error, stop setting
  ATACH_IRQ_WAIT in ch_flags; pass the state via the last parameter
  to c_intr() routine
- add NCQ recovery and KILL_REQUEUE
- only call atastart() in c_intr() if there was no error

several siisata specific tweaks:
- improve reset to better handle PM - need to reset couple more registers
- add timeouts for unbusy wait - ATA_DELAY (10s)
- siisata_bio_complete() do not use PRSO_RTC for byte count for NCQ transfers,
  they never return partial reads; and that register might contain some random
  junk, at least that's the case with ahcisata cmdh_prdbc

Revision 1.30.4.25: download - view: text, markup, annotated - select for diffs
Tue Jun 27 20:13:56 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.24: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.24: +6 -2 lines
need to explicitely call siisata_timeout() also for polled bio command when
it times out to clean up; this should avoid the 'polled command has been
queued' panic from wddump()

Revision 1.30.4.24: download - view: text, markup, annotated - select for diffs
Tue Jun 27 18:36:04 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.23: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.23: +61 -38 lines
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.30.4.23: download - view: text, markup, annotated - select for diffs
Mon Jun 26 20:36:14 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.22: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.22: +6 -6 lines
when reducing DELAY(), it's necessary to appropriately increase number
of iteration, or command can timeout too soon

adjust also siisata_atapi_start() to use DELAY(100) for the polled command,
mostly for consistency, ATAPI devices are quite slow so likely won't have
real effect

Revision 1.30.4.22: download - view: text, markup, annotated - select for diffs
Sat Jun 24 11:34:33 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.21: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.21: +3 -3 lines
reduce the polling interval also for siisata_cmd_start()

Revision 1.30.4.21: download - view: text, markup, annotated - select for diffs
Fri Jun 23 23:49:20 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.20: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.20: +2 -2 lines
fix dump for siisata(4) to work - need to call drv_done() callback in order to
not leak xfers

while here, reduce the DELAY() for polled bio to make it go much faster,
same value as used in ahcisata(4)

needs also rev. 1.252 src/sys/arch/x86/x86/pmap.c to not trigger the
assertion, the pmap.c fix committed only on HEAD

Revision 1.30.4.20: download - view: text, markup, annotated - select for diffs
Fri Jun 23 23:45:56 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.19: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.19: +4 -5 lines
ata/TODO.ncq

Revision 1.30.4.19: download - view: text, markup, annotated - select for diffs
Wed Jun 21 19:38:43 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.18: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.18: +4 -4 lines
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.30.4.18: download - view: text, markup, annotated - select for diffs
Tue Jun 20 21:00:47 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.17: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.17: +8 -5 lines
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

siisata(4) part, including fix to hang on drive probe (missing ata_free_xfer())

Revision 1.30.4.17: download - view: text, markup, annotated - select for diffs
Mon Jun 19 21:00:00 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.16: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.16: +35 -16 lines
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.30.4.16: download - view: text, markup, annotated - select for diffs
Fri Jun 16 20:40:49 2017 UTC (7 years, 10 months ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.15: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.15: +7 -7 lines
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.30.4.15: download - view: text, markup, annotated - select for diffs
Tue Jun 13 00:02:19 2017 UTC (7 years, 10 months ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.14: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.14: +169 -105 lines
Add NCQ support to siisata(4).

There are still issues that need to be address before I consider this
mergable.

Revision 1.28.2.3: download - view: text, markup, annotated - select for diffs
Wed Apr 26 02:53:11 2017 UTC (8 years ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.28.2.2: preferred, colored; branchpoint 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28.2.2: +60 -66 lines
Sync with HEAD

Revision 1.30.4.14: download - view: text, markup, annotated - select for diffs
Mon Apr 24 21:19:21 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.13: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.13: +7 -15 lines
Merge HEAD.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Mon Apr 24 21:14:32 2017 UTC (8 years ago) by jakllsch
Branches: MAIN
CVS tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-20170426, perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-3-RELEASE, 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
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +7 -15 lines
Fix PRB blanking, so as not to stomp on the feet of neighboring slots.
Also, don't blank some PRB fields twice.

[:U+1F633:]

Revision 1.30.4.13: download - view: text, markup, annotated - select for diffs
Mon Apr 24 13:24:33 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.12: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.12: +3 -3 lines
Merge HEAD.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Mon Apr 24 13:19:50 2017 UTC (8 years ago) by jakllsch
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +3 -3 lines
Fix typo in comment.

Revision 1.30.4.12: download - view: text, markup, annotated - select for diffs
Mon Apr 24 13:09:37 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.11: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.11: +48 -49 lines
Merge HEAD.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Mon Apr 24 12:58:15 2017 UTC (8 years ago) by jakllsch
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +54 -52 lines
Drop unused prototype. Whitespace fixes. Wrap/re-wrap long lines.

Revision 1.30.4.11: download - view: text, markup, annotated - select for diffs
Sun Apr 23 14:33:28 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.10: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.10: +3 -3 lines
Allocate a full compliment of queue slots for each channel.

Revision 1.30.4.10: download - view: text, markup, annotated - select for diffs
Sun Apr 23 14:25:02 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.9: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.9: +3 -6 lines
Use ata_kill_active() in siisata_reset_channel() so as to ensure all
in-flight xfers are taken care of.

Revision 1.30.4.9: download - view: text, markup, annotated - select for diffs
Sun Apr 23 01:26:50 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.8: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.8: +3 -3 lines
Fix inverted ata_waitdrain_xfer_check() logic in siisata_atapi_complete().

Revision 1.30.4.8: download - view: text, markup, annotated - select for diffs
Sat Apr 22 14:08:38 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.7: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.7: +4 -3 lines
Another one missed in previous.

Revision 1.30.4.7: download - view: text, markup, annotated - select for diffs
Sat Apr 22 13:40:50 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.6: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.6: +3 -3 lines
3rd xfer interrupt argument fix change missed in previous.

Revision 1.30.4.6: download - view: text, markup, annotated - select for diffs
Sat Apr 22 13:19:28 2017 UTC (8 years ago) by jakllsch
Branches: jdolecek-ncq
Diff to: previous 1.30.4.5: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.5: +9 -8 lines
Don't use the third argument of the xfer interrupt functions to pass the slot number in siisata(4).

This (abuse) is redundant because we are now storing the slot in the xfer structure.

Revision 1.30.4.5: download - view: text, markup, annotated - select for diffs
Wed Apr 19 20:49:17 2017 UTC (8 years ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.4: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.4: +15 -15 lines
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.30.4.4: download - view: text, markup, annotated - select for diffs
Sat Apr 15 17:14:11 2017 UTC (8 years ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.3: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.3: +16 -23 lines
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.30.4.3: download - view: text, markup, annotated - select for diffs
Sat Apr 15 12:01:23 2017 UTC (8 years ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.2: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.2: +9 -14 lines
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.30.4.2: download - view: text, markup, annotated - select for diffs
Tue Apr 11 18:13:17 2017 UTC (8 years ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30.4.1: preferred, colored; branchpoint 1.30: preferred, colored
Changes since revision 1.30.4.1: +5 -5 lines
fix to not access active_xfer directly

Revision 1.30.4.1: download - view: text, markup, annotated - select for diffs
Mon Apr 10 22:57:02 2017 UTC (8 years ago) by jdolecek
Branches: jdolecek-ncq
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +22 -27 lines
ATA infrastructure improvements to eventually support more outstanding
commands

patch by Matt Thomas

Revision 1.27.6.3: download - view: text, markup, annotated - select for diffs
Sun Feb 5 13:40:28 2017 UTC (8 years, 2 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.27.6.2: preferred, colored; branchpoint 1.27: preferred, colored
Changes since revision 1.27.6.2: +7 -2 lines
Sync with HEAD

Revision 1.28.2.2: download - view: text, markup, annotated - select for diffs
Sat Jan 7 08:56:32 2017 UTC (8 years, 3 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.28.2.1: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.1: +7 -2 lines
Sync with HEAD.  (Note that most of these changes are simply $NetBSD$
tag issues.)

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue Jan 3 01:30:15 2017 UTC (8 years, 3 months ago) by jakllsch
Branches: MAIN
CVS tags: pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, jdolecek-ncq-base, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: jdolecek-ncq
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +7 -2 lines
The SiI3124 was implemented at a time when the ATA/ACS2
DATA SET MANAGEMENT/TRIM command did not exist.  As such, the (presumably
immutable) lookup table in the chip does not know that this command
indicates a data write to follow.  Use the PRB Protocol Override
functionality to tell the chip the protocol we need for this command.

For PR kern/51756.

Revision 1.28.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 4 14:49:09 2016 UTC (8 years, 5 months ago) by pgoyette
Branches: pgoyette-localcount
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +4 -5 lines
Sync with HEAD

Revision 1.27.6.2: download - view: text, markup, annotated - select for diffs
Wed Oct 5 20:55:41 2016 UTC (8 years, 6 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.27.6.1: preferred, colored; branchpoint 1.27: preferred, colored
Changes since revision 1.27.6.1: +13 -14 lines
Sync with HEAD

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon Sep 19 19:07:53 2016 UTC (8 years, 7 months ago) by jakllsch
Branches: MAIN
CVS tags: pgoyette-localcount-20161104, nick-nhusb-base-20161204, nick-nhusb-base-20161004
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +4 -5 lines
Don't permanantly disable port if drive probe times out,
reinitialize port instead.

Revision 1.27.6.1: download - view: text, markup, annotated - select for diffs
Sun May 29 08:44:21 2016 UTC (8 years, 11 months ago) by skrll
Branches: nick-nhusb
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +8 -7 lines
Sync with HEAD

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon May 2 19:18:29 2016 UTC (8 years, 11 months ago) by christos
Branches: MAIN
CVS tags: pgoyette-localcount-base, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20160907, nick-nhusb-base-20160529, localcount-20160914
Branch point for: pgoyette-localcount
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +8 -7 lines
move scsipi_strvis -> libkern:strnvisx()
change the prototype to match userland
fix sizes of strings passed to it

Revision 1.22.2.3: download - view: text, markup, annotated - select for diffs
Wed Aug 20 00:03:38 2014 UTC (10 years, 8 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.22.2.2: preferred, colored
Changes since revision 1.22.2.2: +2 -2 lines
Rebase to HEAD as of a few days ago.

Revision 1.15.2.3: download - view: text, markup, annotated - select for diffs
Thu May 22 11:40:22 2014 UTC (10 years, 11 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.15.2.2: preferred, colored; branchpoint 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15.2.2: +7 -7 lines
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.2.14.3: download - view: text, markup, annotated - select for diffs
Fri Feb 14 18:38:15 2014 UTC (11 years, 2 months ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.2.14.2: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.14.2: +3 -4 lines
Change KASSERTMSG/KDASSERTMSG to use varadic arguments like HEAD.
panic -> vpanic, add panic wrapper to vpanic.

Revision 1.26.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 28 23:59:25 2013 UTC (11 years, 8 months ago) by rmind
Branches: rmind-smpnet
Diff to: previous 1.26: preferred, colored; next MAIN 1.27: preferred, colored
Changes since revision 1.26: +3 -3 lines
sync with head

Revision 1.27: download - view: text, markup, annotated - select for diffs
Thu Aug 8 17:38:56 2013 UTC (11 years, 8 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, 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, 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
Branch point for: nick-nhusb
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +3 -3 lines
Fix reverted condition. Fix panic reported by Patrick Welche on
current-users with an ATAPI device connected to siisata.

Revision 1.22.2.2: download - view: text, markup, annotated - select for diffs
Sun Jun 23 06:20:17 2013 UTC (11 years, 10 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.22.2.1: preferred, colored
Changes since revision 1.22.2.1: +5 -5 lines
resync from head

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sat Jun 22 05:41:25 2013 UTC (11 years, 10 months ago) by matt
Branches: MAIN
CVS tags: riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2
Branch point for: rmind-smpnet
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +3 -3 lines
Make sure dynamically allocated channel_queue struct are zero-filled.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Jun 9 09:44:51 2013 UTC (11 years, 10 months ago) by njoly
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +3 -3 lines
Add missing parenthesis.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed Apr 3 17:15:07 2013 UTC (12 years ago) by bouyer
Branches: MAIN
CVS tags: khorben-n900
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +4 -4 lines
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.22.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 20 03:02:07 2012 UTC (12 years, 5 months ago) by tls
Branches: tls-maxphys
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +24 -2 lines
Resync to 2012-11-19 00:00:00 UTC

Revision 1.15.2.2: download - view: text, markup, annotated - select for diffs
Tue Oct 30 17:21:08 2012 UTC (12 years, 5 months ago) by yamt
Branches: yamt-pagecache
CVS tags: yamt-pagecache-tag8
Diff to: previous 1.15.2.1: preferred, colored; branchpoint 1.15: preferred, colored
Changes since revision 1.15.2.1: +106 -80 lines
sync with head

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Oct 22 16:43:05 2012 UTC (12 years, 6 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, agc-symver-base, agc-symver
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +24 -2 lines
Work around missing __BUS_SPACE_HAS_STREAM_METHODS on some ports.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue Jul 31 15:50:34 2012 UTC (12 years, 8 months ago) by bouyer
Branches: MAIN
Branch point for: tls-maxphys
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +84 -80 lines
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.21: download - view: text, markup, annotated - select for diffs
Thu Jul 26 20:49:48 2012 UTC (12 years, 9 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +74 -78 lines
Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@

Revision 1.20: download - view: text, markup, annotated - select for diffs
Tue Jul 24 14:04:30 2012 UTC (12 years, 9 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +9 -9 lines
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.19: download - view: text, markup, annotated - select for diffs
Sun Jul 15 10:55:30 2012 UTC (12 years, 9 months ago) by dsl
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +11 -11 lines
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.18: download - view: text, markup, annotated - select for diffs
Mon Jul 2 18:15:47 2012 UTC (12 years, 9 months ago) by bouyer
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +78 -74 lines
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.15.6.2: download - view: text, markup, annotated - select for diffs
Sat Jun 2 11:09:17 2012 UTC (12 years, 10 months ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.15.6.1: preferred, colored; branchpoint 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15.6.1: +74 -27 lines
sync to latest -current.

Revision 1.15.2.1: download - view: text, markup, annotated - select for diffs
Wed May 23 10:07:56 2012 UTC (12 years, 11 months ago) by yamt
Branches: yamt-pagecache
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +76 -28 lines
sync with head.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Tue May 15 19:06:26 2012 UTC (12 years, 11 months ago) by bouyer
Branches: MAIN
CVS tags: yamt-pagecache-base5, jmcneill-usbmp-base10
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +74 -27 lines
Gather disable/enable interruptst at the Port Interrupt Enable level in
2 functions, and use them to disable interrupts for polled commands.
In siisata_probe_drive(), disable interrupt while resetting the PHY and
sending the SOFT_RESET FIS. Also dectect timeout/errors at this level and
disable the port if needed.
Make siisata_intr_port() more resistent to interrupts without xfer (especially
error interrupts which can be asynchrounous, but can also happen for
timed out xfer).

With this, the kernel doesn't pannic when a siisata controller is connected
to a SATA port multiplier. More work is needed to support port multiplier
though.

Revision 1.15.6.1: download - view: text, markup, annotated - select for diffs
Sun Apr 29 23:04:50 2012 UTC (13 years ago) by mrg
Branches: jmcneill-usbmp
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +4 -3 lines
sync to latest -current.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Fri Apr 20 20:23:20 2012 UTC (13 years ago) by bouyer
Branches: MAIN
CVS tags: jmcneill-usbmp-base9
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +4 -3 lines
Add a bustype_async_event_xfer_mode() callback to scsipi_bustype (which can
be NULL), so that transport-specific details of transfer mode setting/printing
can be handled more easily.
Move scsipi_async_event_xfer_mode() and scsipi_print_xfer_mode() to
scsi_base.c and split in parallel scsi and FC/SAS parts.
size of struct scsipi_bustype has changed, welcome to 6.99.5

Revision 1.15: download - view: text, markup, annotated - select for diffs
Tue Sep 27 01:02:38 2011 UTC (13 years, 7 months ago) by jym
Branches: MAIN
CVS tags: yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-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
Branch point for: yamt-pagecache, jmcneill-usbmp
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +5 -5 lines
Modify *ASSERTMSG() so they are now used as variadic macros. The main goal
is to provide routines that do as KASSERT(9) says: append a message
to the panic format string when the assertion triggers, with optional
arguments.

Fix call sites to reflect the new definition.

Discussed on tech-kern@. See
http://mail-index.netbsd.org/tech-kern/2011/09/07/msg011427.html

Revision 1.13.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 6 09:07:54 2011 UTC (13 years, 10 months ago) by jruoho
Branches: jruoho-x86intr
Diff to: previous 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13: +3 -2 lines
Sync with HEAD.

Revision 1.2.14.2: download - view: text, markup, annotated - select for diffs
Fri Apr 29 08:20:50 2011 UTC (14 years ago) by matt
Branches: matt-nb5-mips64
Diff to: previous 1.2.14.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.14.1: +3 -3 lines
Fix sense of KASSERTMSGs

Revision 1.9.4.2: download - view: text, markup, annotated - select for diffs
Sat Mar 5 20:53:20 2011 UTC (14 years, 1 month ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.9.4.1: preferred, colored; branchpoint 1.9: preferred, colored; next MAIN 1.10: preferred, colored
Changes since revision 1.9.4.1: +19 -18 lines
sync with head

Revision 1.13.4.1: download - view: text, markup, annotated - select for diffs
Thu Feb 17 12:00:12 2011 UTC (14 years, 2 months ago) by bouyer
Branches: bouyer-quota2
Diff to: previous 1.13: preferred, colored; next MAIN 1.14: preferred, colored
Changes since revision 1.13: +3 -2 lines
Sync with HEAD

Revision 1.14: download - view: text, markup, annotated - select for diffs
Sun Feb 13 01:21:52 2011 UTC (14 years, 2 months ago) by jakllsch
Branches: MAIN
CVS tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +3 -2 lines
Treat unexpected command completions a little more like regular completions.
Slight chance this might prevent some occasional log spew trouble at shutdown
time.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Nov 13 09:00:00 2010 UTC (14 years, 5 months ago) by uebayasi
Branches: MAIN
CVS tags: matt-mips64-premerge-20101231, jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +3 -4 lines
Include sys/proc.h for tsleep, wakeup.

Revision 1.9.2.2: download - view: text, markup, annotated - select for diffs
Tue Aug 17 06:46:12 2010 UTC (14 years, 8 months ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.9.2.1: preferred, colored; branchpoint 1.9: preferred, colored; next MAIN 1.10: preferred, colored
Changes since revision 1.9.2.1: +15 -14 lines
Sync with HEAD.

Revision 1.2.12.6: download - view: text, markup, annotated - select for diffs
Wed Aug 11 22:53:31 2010 UTC (14 years, 8 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.2.12.5: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.12.5: +44 -46 lines
sync with head.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Jul 26 15:41:33 2010 UTC (14 years, 9 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +17 -16 lines
Store information for bus_dmamem_unmap() and bus_dmamem_free()
somewhere outside the bus_dmamap_t. The bus_dmamap_t has already
been destroyed by this time.

Fixes DMA memory leak at siisata_detach() time.

Revision 1.9.4.1: download - view: text, markup, annotated - select for diffs
Sun May 30 05:17:25 2010 UTC (14 years, 11 months ago) by rmind
Branches: rmind-uvmplock
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +29 -32 lines
sync with head

Revision 1.9.2.1: download - view: text, markup, annotated - select for diffs
Fri Apr 30 14:43:22 2010 UTC (15 years ago) by uebayasi
Branches: uebayasi-xip
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +28 -31 lines
Sync with HEAD.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Sun Apr 25 15:39:41 2010 UTC (15 years ago) by rmind
Branches: MAIN
CVS tags: uebayasi-xip-base1
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -4 lines
Fix KASSERTMSG() to be consistent with KASSERT() logic, not inverted.
Hi matt@!

Revision 1.2.14.1: download - view: text, markup, annotated - select for diffs
Wed Apr 21 00:27:37 2010 UTC (15 years ago) by matt
Branches: matt-nb5-mips64
CVS tags: matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-k15
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +229 -347 lines
sync to netbsd-5

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Apr 7 17:51:16 2010 UTC (15 years ago) by jakllsch
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +27 -30 lines
satafis:
- Add function to parse RDH FIS for use in implementing AT_READREG.
- Correct and clean up some structure definitions.
- Sprinkle a bit of const.
- Remove dependency on <dev/ic/wdcreg.h>, WDCTL_4BIT doesn't seem
  to be specified by any recent ATA standard, and it seems to make
  no difference in practice.
- Stop using WDSD_IBM, these bits have been obsolete since before SATA.

siisata:
- Implement AT_READREG.
- Reap now-unneeded <dev/ic/wdcreg.h>.
- Whitespace and slight debug code cleanup.
- Some possibly-uncessary code reordering.

ahcisata:
- Implement AT_READREG.
- Reap now-unneeded <dev/ic/wdcreg.h>.

Revision 1.2.12.5: download - view: text, markup, annotated - select for diffs
Thu Mar 11 15:03:35 2010 UTC (15 years, 1 month ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.2.12.4: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.12.4: +5 -13 lines
sync with head

Revision 1.9: download - view: text, markup, annotated - select for diffs
Sat Jan 30 16:16:35 2010 UTC (15 years, 3 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-nfs-mp-base9, uebayasi-xip-base
Branch point for: uebayasi-xip, rmind-uvmplock
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +5 -3 lines
Sprinkle __KERNEL_RCSID() into siisata(4).
Slightly adjust some comment styling.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Oct 19 18:41:13 2009 UTC (15 years, 6 months ago) by bouyer
Branches: MAIN
CVS tags: matt-premerge-20091211, jym-xensuspend-nbase
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +1 -11 lines
Remove closes 3 & 4 from my licence. Lots of thanks to Soren Jacobsen
for the booring work !

Revision 1.2.4.5: download - view: text, markup, annotated - select for diffs
Mon Sep 28 00:24:52 2009 UTC (15 years, 7 months ago) by snj
Branches: 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, matt-nb5-pq3-base, matt-nb5-pq3
Diff to: previous 1.2.4.4: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.4.4: +13 -4 lines
Pull up following revision(s) (requested by jakllsch in ticket #1023):
	sys/dev/ata/satafis_subr.c: revision 1.3
	sys/dev/ata/satafisvar.h: revision 1.2
	sys/dev/ic/siisata.c: revision 1.7
	sys/dev/ic/siisatareg.h: revision 1.4
Further corrections for siisata.
Reset ch_status and ch_error at the beginning of any operation.
The chip only writes the RDH FIS to the SRAM when the error bit is
set in a RDH FIS (per the datasheet).  Thus, satafis_sdb_parse() is
replaced with satafis_rhd_parse().  A valid FIS type field seems to
not be written to the SRAM, so don't bother checking it for the
correct magic.
Additionally, append 2009 to copyright year set, and remove
obsolete CVS Id lines from when this was in my repository.

Revision 1.2.4.4: download - view: text, markup, annotated - select for diffs
Mon Sep 28 00:21:13 2009 UTC (15 years, 7 months ago) by snj
Branches: netbsd-5
Diff to: previous 1.2.4.3: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.4.3: +29 -60 lines
Pull up following revision(s) (requested by jakllsch in ticket #1023):
	sys/dev/ic/siisata.c: revision 1.6
Correct various siisata bugs, some old, some new.
 - Move clearing of interrupts to before atastart() is called in the
   xfer interrupt handler.  Should fix kern/41579.
 - Using cv_timedwait(9) is not possible in code that can be called from
   interrupt context, fall back to DELAY(9).
 - Correctly poll Port Slot Status register for soft reset PRBs.
 - Only use the Recive Transfer Count register on reads, when it is valid.
 - Activate PRBs in a way that takes the whole physical address into account,
   even when the PRB is beyond 4GiB.
 - consistently use DELAY(9)
 - Use DELAY() constants in completion polling loops that are consistent with
   the loop count limit. (i.e. timeout in 10 rather than 100 seconds)

Revision 1.2.4.3: download - view: text, markup, annotated - select for diffs
Mon Sep 28 00:19:37 2009 UTC (15 years, 7 months ago) by snj
Branches: netbsd-5
Diff to: previous 1.2.4.2: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.4.2: +12 -12 lines
Pull up following revision(s) (requested by jakllsch in ticket #1023):
	sys/dev/ic/siisata.c: revision 1.5
Use PRO_PS and PRO_PCS correctly.
From Wolfgang Stukenbrock as part of kern/41579.
While here, remove a line of whitespace, and add an else case to
the ATAPI command length toggle.

Revision 1.2.4.2: download - view: text, markup, annotated - select for diffs
Mon Sep 28 00:18:39 2009 UTC (15 years, 7 months ago) by snj
Branches: netbsd-5
Diff to: previous 1.2.4.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.4.1: +4 -2 lines
Pull up following revision(s) (requested by jakllsch in ticket #1023):
	sys/dev/ic/siisata.c: revision 1.4
make this build w/o SIISATA_DEBUG

Revision 1.2.4.1: download - view: text, markup, annotated - select for diffs
Mon Sep 28 00:17:28 2009 UTC (15 years, 7 months ago) by snj
Branches: netbsd-5
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +215 -313 lines
Pull up following revision(s) (requested by jakllsch in ticket #1023):
	sys/dev/ic/siisata.c: revision 1.3
	sys/dev/ic/siisatareg.h: revision 1.3
	sys/dev/ic/siisatavar.h: revision 1.3
	sys/dev/pci/files.pci: revision 1.315
	sys/dev/pci/siisata_pci.c: revision 1.3
A few changes for siisata(4):
 - Support detachment.  From KIYOHARA Takashi.
 - Add PCI detachment functionality (albeit not very interesting when
   the bus can not yet be rescanned).
 - Rework interrupt handlers to reduce near-duplicate code.
   Borrowed from ahcisata(4).
 - Attempt to make polled I/O work. Untested.
 - Fix formatting of some messages.
 - For always-polled commands, disable interrupt
   at slot level rather than port level.
 - Instead of busy-waiting indefinitely for completion of some commands
   move on after 31 seconds. Use cv_timedwait(9) instead of DELAY(9).
 - Use abstracted SATA FIS code.
 - Enable use of disks that don't respond with the standard signature.

Revision 1.2.8.1: download - view: text, markup, annotated - select for diffs
Thu Jul 23 23:31:48 2009 UTC (15 years, 9 months ago) by jym
Branches: jym-xensuspend
Diff to: previous 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2: +229 -347 lines
Sync with HEAD.

Revision 1.2.12.4: download - view: text, markup, annotated - select for diffs
Sat Jul 18 14:53:02 2009 UTC (15 years, 9 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.2.12.3: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.12.3: +52 -74 lines
sync with head.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sat Jul 4 20:57:15 2009 UTC (15 years, 9 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7, yamt-nfs-mp-base6, jymxensuspend-base
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +13 -4 lines
Further corrections for siisata.

Reset ch_status and ch_error at the beginning of any operation.

The chip only writes the RDH FIS to the SRAM when the error bit is
set in a RDH FIS (per the datasheet).  Thus, satafis_sdb_parse() is
replaced with satafis_rhd_parse().  A valid FIS type field seems to
not be written to the SRAM, so don't bother checking it for the
correct magic.

Additionally, append 2009 to copyright year set, and remove
obsolete CVS Id lines from when this was in my repository.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Jun 27 21:04:47 2009 UTC (15 years, 10 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +29 -60 lines
Correct various siisata bugs, some old, some new.

 - Move clearing of interrupts to before atastart() is called in the
   xfer interrupt handler.  Should fix kern/41579.
 - Using cv_timedwait(9) is not possible in code that can be called from
   interrupt context, fall back to DELAY(9).
 - Correctly poll Port Slot Status register for soft reset PRBs.
 - Only use the Recive Transfer Count register on reads, when it is valid.
 - Activate PRBs in a way that takes the whole physical address into account,
   even when the PRB is beyond 4GiB.
 - consistently use DELAY(9)
 - Use DELAY() constants in completion polling loops that are consistent with
   the loop count limit. (i.e. timeout in 10 rather than 100 seconds)

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sun Jun 21 14:15:38 2009 UTC (15 years, 10 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +12 -12 lines
Use PRO_PS and PRO_PCS correctly.
From Wolfgang Stukenbrock as part of kern/41579.

While here, remove a line of whitespace, and add an else case to
the ATAPI command length toggle.

Revision 1.2.12.3: download - view: text, markup, annotated - select for diffs
Sat Jun 20 07:20:22 2009 UTC (15 years, 10 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.2.12.2: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.12.2: +218 -314 lines
sync with head

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Jun 17 19:12:48 2009 UTC (15 years, 10 months ago) by cegger
Branches: MAIN
CVS tags: yamt-nfs-mp-base5
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -2 lines
make this build w/o SIISATA_DEBUG

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed Jun 17 04:37:57 2009 UTC (15 years, 10 months ago) by jakllsch
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +215 -313 lines
A few changes for siisata(4):

 - Support detachment.  From KIYOHARA Takashi.
 - Add PCI detachment functionality (albeit not very interesting when
   the bus can not yet be rescanned).
 - Rework interrupt handlers to reduce near-duplicate code.
   Borrowed from ahcisata(4).
 - Attempt to make polled I/O work. Untested.
 - Fix formatting of some messages.
 - For always-polled commands, disable interrupt
   at slot level rather than port level.
 - Instead of busy-waiting indefinitely for completion of some commands
   move on after 31 seconds. Use cv_timedwait(9) instead of DELAY(9).
 - Use abstracted SATA FIS code.
 - Enable use of disks that don't respond with the standard signature.

Revision 1.2.12.2: download - view: text, markup, annotated - select for diffs
Mon May 4 08:12:44 2009 UTC (15 years, 11 months ago) by yamt
Branches: yamt-nfs-mp
Diff to: previous 1.2.12.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.12.1: +1762 -0 lines
sync with head.

Revision 1.1.10.1: download - view: text, markup, annotated - select for diffs
Sun Oct 19 22:16:27 2008 UTC (16 years, 6 months ago) by haad
Branches: haad-dm
Diff to: previous 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1: +114 -116 lines
Sync with HEAD.

Revision 1.1.2.3: download - view: text, markup, annotated - select for diffs
Sun Sep 28 10:40:23 2008 UTC (16 years, 7 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.1.2.2: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.2.2: +113 -115 lines
Sync with HEAD.

Revision 1.1.8.3: download - view: text, markup, annotated - select for diffs
Wed Sep 24 16:38:52 2008 UTC (16 years, 7 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.1.8.2: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.8.2: +114 -116 lines
Merge in changes between wrstuden-revivesa-base-2 and
wrstuden-revivesa-base-3.

Revision 1.2.12.1
Sun Sep 14 21:53:49 2008 UTC (16 years, 7 months ago) by yamt
Branches: yamt-nfs-mp
FILE REMOVED
Changes since revision 1.2: +0 -1762 lines
file siisata.c was added on branch yamt-nfs-mp on 2009-05-04 08:12:44 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Sep 14 21:53:49 2008 UTC (16 years, 7 months ago) by jakllsch
Branches: MAIN
CVS tags: yamt-nfs-mp-base4, yamt-nfs-mp-base3, wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base2, nick-hppapmap-base, nick-hppapmap, netbsd-5-base, 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, mjf-devfs2-base, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20091211, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, jym-xensuspend-base, haad-nbase2, haad-dm-base2, haad-dm-base1, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: yamt-nfs-mp, netbsd-5, matt-nb5-mips64, jym-xensuspend
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +114 -116 lines
A few cleanups for siisata(4)

No functional changes intended (except maybe un-reseting the chip a bit later
in attach).

 - pass fewer arguments to local functions where arguments can be derived from
   an existing argument
 - some coding style fixes
 - more abstraction for PRB activation and deactivation
 - bus_dma(9) properification in error cases
 - undefine SIISATA_DEBUG, and cleanup variables used only for DEBUG_PRINT()s

Revision 1.1.8.2: download - view: text, markup, annotated - select for diffs
Mon Jun 23 05:02:13 2008 UTC (16 years, 10 months ago) by wrstuden
Branches: wrstuden-revivesa
Diff to: previous 1.1.8.1: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.8.1: +1764 -0 lines
Add files to branch that were added on -current.

After this, all that's left of update is to merge some changes
that had conflicts.

Revision 1.1.4.2: download - view: text, markup, annotated - select for diffs
Wed Jun 4 02:05:10 2008 UTC (16 years, 10 months ago) by yamt
Branches: yamt-pf42
Diff to: previous 1.1.4.1: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.4.1: +1764 -0 lines
sync with head

Revision 1.1.2.2: download - view: text, markup, annotated - select for diffs
Mon Jun 2 13:23:27 2008 UTC (16 years, 10 months ago) by mjf
Branches: mjf-devfs2
Diff to: previous 1.1.2.1: preferred, colored; branchpoint 1.1: preferred, colored
Changes since revision 1.1.2.1: +1764 -0 lines
Sync with HEAD.

Revision 1.1.8.1
Fri May 23 21:11:40 2008 UTC (16 years, 11 months ago) by wrstuden
Branches: wrstuden-revivesa
FILE REMOVED
Changes since revision 1.1: +0 -1764 lines
file siisata.c was added on branch wrstuden-revivesa on 2008-06-23 05:02:13 +0000

Revision 1.1.4.1
Fri May 23 21:11:40 2008 UTC (16 years, 11 months ago) by yamt
Branches: yamt-pf42
FILE REMOVED
Changes since revision 1.1: +0 -1764 lines
file siisata.c was added on branch yamt-pf42 on 2008-06-04 02:05:10 +0000

Revision 1.1.2.1
Fri May 23 21:11:40 2008 UTC (16 years, 11 months ago) by mjf
Branches: mjf-devfs2
FILE REMOVED
Changes since revision 1.1: +0 -1764 lines
file siisata.c was added on branch mjf-devfs2 on 2008-06-02 13:23:27 +0000

Revision 1.1: download - view: text, markup, annotated - select for diffs
Fri May 23 21:11:40 2008 UTC (16 years, 11 months ago) by jnemeth
Branches: MAIN
CVS tags: yamt-pf42-base4, yamt-pf42-base3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, simonb-wapbl-nbase, simonb-wapbl-base, simonb-wapbl
Branch point for: yamt-pf42, wrstuden-revivesa, mjf-devfs2, haad-dm
Import siisata(4) by Jonathan A. Kollasch.

     The siisata driver supports the Silicon Image SteelVine family of SATA-II
     controllers, interfacing the hardware with the ata(4) and atapi(4) sub-
     systems.

     The following controllers are supported by the siisata driver:

           Silicon Image SiI3124 4-port PCI/PCI-X
           Silicon Image SiI3132 2-port PCI-Express x1
           Silicon Image SiI3531 1-port PCI-Express x1

     SATA Native Command Queueing is not yet supported.
     Device hot swapping is not yet supported.
     Silicon Image's Software RAID is not yet supported by the
             ataraid(4) driver.

Approved by: core (christos), releng (bouyer)

Diff request

This form allows you to request diffs 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.

Log view options

CVSweb <webmaster@jp.NetBSD.org>