aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fdc/fdc_cbus.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-04-21 18:37:36 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2016-04-21 18:37:36 +0000
commitfed2c48af44fc086063940a614e985407e481eba (patch)
tree359e067b8031c1e64bd82089814789128f9d0a4c /sys/dev/fdc/fdc_cbus.c
parentf8887b894ce2df14f90cfbd77d239f45d4a91214 (diff)
downloadsrc-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_cbus.c')
-rw-r--r--sys/dev/fdc/fdc_cbus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/fdc/fdc_cbus.c b/sys/dev/fdc/fdc_cbus.c
index ee1598dccb07..b03b370375d8 100644
--- a/sys/dev/fdc/fdc_cbus.c
+++ b/sys/dev/fdc/fdc_cbus.c
@@ -150,7 +150,9 @@ fdc_cbus_attach(device_t dev)
error = fdc_attach(dev);
if (error == 0)
error = fdc_hints_probe(dev);
- if (error)
+ if (error == 0)
+ fdc_start_worker(dev);
+ else
fdc_release_resources(fdc);
return (error);
}