diff options
author | John Baldwin <jhb@FreeBSD.org> | 2016-04-21 18:37:36 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2016-04-21 18:37:36 +0000 |
commit | fed2c48af44fc086063940a614e985407e481eba (patch) | |
tree | 359e067b8031c1e64bd82089814789128f9d0a4c /sys/dev/fdc/fdc_pccard.c | |
parent | f8887b894ce2df14f90cfbd77d239f45d4a91214 (diff) | |
download | src-fed2c48af44fc086063940a614e985407e481eba.tar.gz src-fed2c48af44fc086063940a614e985407e481eba.zip |
Adjust the fdc worker thread startup to work when APs are started earlier.
- Enable the commented out locking in fd_probe(). The worker thread
should not be running yet (even after these changes), but better to be
safe than sorry.
- Defer starting the worker thread until after the child drives have been
probed. The worker thread startup is moved into a fdc_start_worker()
thread that the various front ends call at the end of attach. As a
side effect this fixes a few edge cases that weren't shutting down the
worker thread if attach encountered a late failure.
- When executing the initial reset requested by attach in the worker
thread, use DELAY() instead of a tsleep() if cold is set.
Tested by: Howard Su <howard0su@gmail.com>
Sponsored by: Netflix
Notes
Notes:
svn path=/head/; revision=298426
Diffstat (limited to 'sys/dev/fdc/fdc_pccard.c')
-rw-r--r-- | sys/dev/fdc/fdc_pccard.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/fdc/fdc_pccard.c b/sys/dev/fdc/fdc_pccard.c index e04513f55b31..767a4d157a13 100644 --- a/sys/dev/fdc/fdc_pccard.c +++ b/sys/dev/fdc/fdc_pccard.c @@ -108,7 +108,9 @@ fdc_pccard_attach(device_t dev) device_set_flags(child, 0x24); error = bus_generic_attach(dev); } - if (error) + if (error == 0) + fdc_start_worker(dev); + else fdc_release_resources(fdc); return (error); } |