The NetBSD Project

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

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.2.8.2: download - view: text, markup, annotated - select for diffs
Fri Dec 30 14:39:10 2022 UTC (23 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-4-RELEASE
Diff to: previous 1.2.8.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.8.1: +5 -7 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.2.8.1: download - view: text, markup, annotated - select for diffs
Tue Feb 8 14:45:00 2022 UTC (2 years, 9 months ago) by martin
Branches: netbsd-9
CVS tags: netbsd-9-3-RELEASE
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +5 -2 lines
Pull up following revision(s) (requested by jdolecek in ticket #1426):

	sys/dev/ata/ata_recovery.c: revision 1.3
	sys/dev/ata/ata_subr.c: revision 1.9

stop xfer timeouts during recovery, all xfers will be requeued anyway
this avoids race with the timeout routine when processing the xfers
for requeueing

should fix PR kern/54790 by Izumi Tsutsui

Revision 1.2.6.4: download - view: text, markup, annotated - select for diffs
Tue Apr 21 18:42:15 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.2.6.3: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.6.3: +3 -5 lines
Sync with HEAD

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

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Apr 13 10:49:34 2020 UTC (4 years, 7 months ago) by jdolecek
Branches: MAIN
CVS tags: thorpej-ifq-base, thorpej-ifq, thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-i2c-spi-conf, thorpej-futex2-base, thorpej-futex2, thorpej-futex-base, thorpej-futex, thorpej-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, phil-wifi-20200421, perseant-exfatfs-base-20240630, perseant-exfatfs-base, perseant-exfatfs, netbsd-10-base, 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, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-xenpvh-base2, bouyer-xenpvh-base1, bouyer-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +5 -7 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.2.6.3: download - view: text, markup, annotated - select for diffs
Wed Apr 8 14:08:03 2020 UTC (4 years, 7 months ago) by martin
Branches: phil-wifi
Diff to: previous 1.2.6.2: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.6.2: +5 -2 lines
Merge changes from current as of 20200406

Revision 1.3: download - view: text, markup, annotated - select for diffs
Sat Apr 4 22:30:02 2020 UTC (4 years, 8 months ago) by jdolecek
Branches: MAIN
CVS tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +5 -2 lines
stop xfer timeouts during recovery, all xfers will be requeued anyway

this avoids race with the timeout routine when processing the xfers
for requeueing

should fix PR kern/54790 by Izumi Tsutsui

Revision 1.2.6.2: download - view: text, markup, annotated - select for diffs
Mon Jun 10 22:07:05 2019 UTC (5 years, 5 months ago) by christos
Branches: phil-wifi
Diff to: previous 1.2.6.1: preferred, colored; branchpoint 1.2: preferred, colored
Changes since revision 1.2.6.1: +250 -0 lines
Sync with HEAD

Revision 1.2.2.2: download - view: text, markup, annotated - select for diffs
Mon Nov 26 01:52:30 2018 UTC (6 years ago) by pgoyette
Branches: pgoyette-compat
CVS tags: pgoyette-compat-merge-20190127
Diff to: previous 1.2.2.1: preferred, colored; branchpoint 1.2: preferred, colored; next MAIN 1.3: preferred, colored
Changes since revision 1.2.2.1: +250 -0 lines
Sync with HEAD, resolve a couple of conflicts

Revision 1.2.6.1
Mon Oct 22 20:13:47 2018 UTC (6 years, 1 month ago) by christos
Branches: phil-wifi
FILE REMOVED
Changes since revision 1.2: +0 -250 lines
file ata_recovery.c was added on branch phil-wifi on 2019-06-10 22:07:05 +0000

Revision 1.2.2.1
Mon Oct 22 20:13:47 2018 UTC (6 years, 1 month ago) by pgoyette
Branches: pgoyette-compat
FILE REMOVED
Changes since revision 1.2: +0 -250 lines
file ata_recovery.c was added on branch pgoyette-compat on 2018-11-26 01:52:30 +0000

Revision 1.2: download - view: text, markup, annotated - select for diffs
Mon Oct 22 20:13:47 2018 UTC (6 years, 1 month ago) by jdolecek
Branches: MAIN
CVS tags: phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, netbsd-9-base, 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, is-mlppp-base, is-mlppp, ad-namecache-base3, ad-namecache-base2, ad-namecache-base1, ad-namecache-base, ad-namecache
Branch point for: phil-wifi, pgoyette-compat, netbsd-9
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +250 -0 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.1.2.2: download - view: text, markup, annotated - select for diffs
Mon Oct 15 21:18:53 2018 UTC (6 years, 1 month ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.1.2.1: preferred, colored; branchpoint 1.1: preferred, colored; next MAIN 1.2: preferred, colored
Changes since revision 1.1.2.1: +13 -10 lines
change the SATA/NCQ recovery to run in the atabus thread

Revision 1.1.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 11 20:57:51 2018 UTC (6 years, 1 month ago) by jdolecek
Branches: jdolecek-ncqfixes
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +247 -0 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.1
Thu Oct 11 20:57:51 2018 UTC (6 years, 1 month ago) by jdolecek
Branches: MAIN
CVS tags: pgoyette-compat-1020
Branch point for: jdolecek-ncqfixes
FILE REMOVED
file ata_recovery.c was initially added on branch jdolecek-ncqfixes.

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>