The NetBSD Project

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

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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.8.4.1 / (download) - annotate - [select for diffs], Tue Feb 8 14:45:00 2022 UTC (2 years, 2 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE
Changes since 1.8: +7 -2 lines
Diff to previous 1.8 (colored) next main 1.9 (colored) to selected 1.4 (colored)

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.11.2.1 / (download) - annotate - [select for diffs], Sun Jan 3 16:34:57 2021 UTC (3 years, 3 months ago) by thorpej
Branch: thorpej-futex
Changes since 1.11: +5 -4 lines
Diff to previous 1.11 (colored) next main 1.12 (colored) to selected 1.4 (colored)

Sync w/ HEAD.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Dec 23 08:17:01 2020 UTC (3 years, 3 months ago) by skrll
Branch: 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-cfargs2-base, thorpej-cfargs2, thorpej-cfargs-base, thorpej-cfargs, thorpej-altq-separation-base, thorpej-altq-separation, 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-sunxi-drm-base, bouyer-sunxi-drm, HEAD
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored) to selected 1.4 (colored)

Add missing '\n' in debug

Revision 1.12 / (download) - annotate - [select for diffs], Sat Dec 19 18:09:44 2020 UTC (3 years, 3 months ago) by jmcneill
Branch: MAIN
Changes since 1.11: +4 -3 lines
Diff to previous 1.11 (colored) to selected 1.4 (colored)

ata_timeout: restore spl in ATACH_RECOVERING path

Revision 1.11 / (download) - annotate - [select for diffs], Sat May 2 19:09:56 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
Branch point for: thorpej-futex
Changes since 1.10: +2 -5 lines
Diff to previous 1.10 (colored) to selected 1.4 (colored)

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

Revision 1.9.2.1 / (download) - annotate - [select for diffs], Sat Apr 25 11:23:59 2020 UTC (3 years, 11 months ago) by bouyer
Branch: bouyer-xenpvh
Changes since 1.9: +7 -4 lines
Diff to previous 1.9 (colored) next main 1.10 (colored) to selected 1.4 (colored)

Sync with bouyer-xenpvh-base2 (HEAD)

Revision 1.10 / (download) - annotate - [select for diffs], Sat Apr 25 00:07:27 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.9: +7 -4 lines
Diff to previous 1.9 (colored) to selected 1.4 (colored)

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

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

Revision 1.4.6.2 / (download) - annotate - [select for diffs], Wed Apr 8 14:08:03 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.4.6.1: +7 -2 lines
Diff to previous 1.4.6.1 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.4 (colored)

Merge changes from current as of 20200406

Revision 1.9 / (download) - annotate - [select for diffs], Sat Apr 4 22:30:02 2020 UTC (4 years ago) by jdolecek
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base1, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.8: +7 -2 lines
Diff to previous 1.8 (colored) to selected 1.4 (colored)

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.4.6.1 / (download) - annotate - [select for diffs], Mon Jun 10 22:07:06 2019 UTC (4 years, 10 months ago) by christos
Branch: phil-wifi
Changes since 1.4: +128 -189 lines
Diff to previous 1.4 (colored)

Sync with HEAD

Revision 1.4.4.2 / (download) - annotate - [select for diffs], Mon Nov 26 01:52:30 2018 UTC (5 years, 4 months ago) by pgoyette
Branch: pgoyette-compat
CVS Tags: pgoyette-compat-merge-20190127
Changes since 1.4.4.1: +122 -212 lines
Diff to previous 1.4.4.1 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.4 (colored)

Sync with HEAD, resolve a couple of conflicts

Revision 1.8 / (download) - annotate - [select for diffs], Wed Nov 7 17:05:54 2018 UTC (5 years, 5 months ago) by jdolecek
Branch: 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: netbsd-9
Changes since 1.7: +5 -2 lines
Diff to previous 1.7 (colored) to selected 1.4 (colored)

don't touch the queue structure in ata_queue_active() if atabus is already
detached from the channel

fixes panic on null pointer derefence during shutdown reported privately
by Launey Thomas

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 22 20:13:47 2018 UTC (5 years, 5 months ago) by jdolecek
Branch: MAIN
Changes since 1.6: +119 -212 lines
Diff to previous 1.6 (colored) to selected 1.4 (colored)

Merge jdolecek-ncqfixes branch

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

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

Revision 1.6.2.8 / (download) - annotate - [select for diffs], Thu Oct 11 20:57:51 2018 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.7: +41 -2 lines
Diff to previous 1.6.2.7 (colored) to branchpoint 1.6 (colored) next main 1.7 (colored) to selected 1.4 (colored)

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

move the shared recovery code into separate file ata_recovery.c

Revision 1.6.2.7 / (download) - annotate - [select for diffs], Sat Oct 6 21:19:55 2018 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.6: +3 -3 lines
Diff to previous 1.6.2.6 (colored) to branchpoint 1.6 (colored) to selected 1.4 (colored)

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

also for PR kern/47041

Revision 1.6.2.6 / (download) - annotate - [select for diffs], Sat Sep 22 17:50:09 2018 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.5: +2 -50 lines
Diff to previous 1.6.2.5 (colored) to branchpoint 1.6 (colored) to selected 1.4 (colored)

remove explicit ata_channel_start() calls, it's no longer necessary
now that ata_xfer's are allocated via pool and not really limited;
replace by just a callout to restart the processing for rare cases
where system runs out of memory

Revision 1.6.2.5 / (download) - annotate - [select for diffs], Sat Sep 22 09:22:59 2018 UTC (5 years, 6 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.4: +48 -154 lines
Diff to previous 1.6.2.4 (colored) to branchpoint 1.6 (colored) to selected 1.4 (colored)

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

primarily to help PR kern/52614

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

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

Revision 1.6.2.4 / (download) - annotate - [select for diffs], Mon Sep 17 20:54:41 2018 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.3: +3 -2 lines
Diff to previous 1.6.2.3 (colored) to branchpoint 1.6 (colored) to selected 1.4 (colored)

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

Revision 1.6.2.3 / (download) - annotate - [select for diffs], Mon Sep 17 19:00:43 2018 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.2: +3 -3 lines
Diff to previous 1.6.2.2 (colored) to branchpoint 1.6 (colored) to selected 1.4 (colored)

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

Revision 1.6.2.2 / (download) - annotate - [select for diffs], Mon Sep 17 18:36:13 2018 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6.2.1: +4 -3 lines
Diff to previous 1.6.2.1 (colored) to branchpoint 1.6 (colored) to selected 1.4 (colored)

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

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

Revision 1.4.4.1 / (download) - annotate - [select for diffs], Thu Sep 6 06:55:48 2018 UTC (5 years, 7 months ago) by pgoyette
Branch: pgoyette-compat
Changes since 1.4: +33 -4 lines
Diff to previous 1.4 (colored)

Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Fri Aug 31 19:08:03 2018 UTC (5 years, 7 months ago) by jdolecek
Branch: jdolecek-ncqfixes
Changes since 1.6: +51 -31 lines
Diff to previous 1.6 (colored) to selected 1.4 (colored)

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

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

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

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

towards resolution of kern/52614

Revision 1.6 / (download) - annotate - [select for diffs], Fri Aug 10 22:43:22 2018 UTC (5 years, 8 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, jdolecek-ncqfixes-base
Branch point for: jdolecek-ncqfixes
Changes since 1.5: +5 -4 lines
Diff to previous 1.5 (colored) to selected 1.4 (colored)

fix race in wd_lastclose() on systems with two ide disks on same
channel, which happened when one disk had pending I/O while the other
disk executed the final disk flush - need to restart bufq processing
once xfer is freed in this case

it could happen e.g. on boot when system executes fsck on different
partitions on the two drives in parallell and hence open and closes
the disk devices repeatedly

add KASSERT() for empty bufq on wd_lastclose(), and fix similar issue
also on suspend/standby path

this was introduced by the NCQ merge and not dksubr - before the merge
each drive had their own xfer, so they could not block each other

fixes PR kern/52783 by Onno van der Linden; many thanks for extensive
help with tracking this down

Revision 1.5 / (download) - annotate - [select for diffs], Mon Aug 6 20:07:05 2018 UTC (5 years, 8 months ago) by jdolecek
Branch: MAIN
Changes since 1.4: +30 -2 lines
Diff to previous 1.4 (colored)

add wddebug() which dumps some status for attached disks; indended for
debugging of PR kern/52783

Revision 1.4.2.2 / (download) - annotate - [select for diffs], Sun Dec 3 11:36:59 2017 UTC (6 years, 4 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.4.2.1: +438 -0 lines
Diff to previous 1.4.2.1 (colored) to branchpoint 1.4 (colored) next main 1.5 (colored) to selected 1.4 (colored)

update from HEAD

Revision 1.4.2.1, Fri Oct 20 07:06:07 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: tls-maxphys
Changes since 1.4: +0 -438 lines
FILE REMOVED

file ata_subr.c was added on branch tls-maxphys on 2017-12-03 11:36:59 +0000

Revision 1.4 / (download) - annotate - [selected], Fri Oct 20 07:06:07 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202, phil-wifi-base, pgoyette-compat-base, 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
Branch point for: tls-maxphys, phil-wifi, pgoyette-compat
Changes since 1.3: +12 -2 lines
Diff to previous 1.3 (colored)

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

on topic of PR kern/52606

Revision 1.3 / (download) - annotate - [select for diffs], Thu Oct 19 20:45:07 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.2: +12 -4 lines
Diff to previous 1.2 (colored) to selected 1.4 (colored)

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

Revision 1.2 / (download) - annotate - [select for diffs], Tue Oct 17 18:52:50 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored) to selected 1.4 (colored)

reintroduce ATACH_IRQ_WAIT flag for attachments using wdcintr(), only
process the interrupt when the flag is set - this fixes spurious interrupt
during post-reset drive setup in wdc_ata_bio_start(), and wdc_atapi_start()

while those functions set WDCTL_IDS, this seems to be ignored by certain
(maybe all) PCI-IDE controllers; usually the implicit KERNEL_LOCK() would
prevent the interrupt anyway, but not when the start routine is started
from the atabus thread, which doesn't take it

fixes 'panic: wdc_ata_bio_intr: bad state' reported on current-users
by Chavdar Ivanov

Revision 1.1 / (download) - annotate - [select for diffs], Tue Oct 10 17:19:38 2017 UTC (6 years, 6 months ago) by jdolecek
Branch: MAIN
Diff to selected 1.4 (colored)

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

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




CVSweb <webmaster@jp.NetBSD.org>