diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2008-01-11 16:50:52 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2008-01-11 16:50:52 +0000 |
commit | 89a828fde94cfb83da985c9d727c28e0bac0b100 (patch) | |
tree | 6785e2b73b8c0912ddc5f316e61d5a249617be37 /sys/dev/fdc/fdc.c | |
parent | d1127e669cc7121e0a4c315e00e7b6b6e87d627b (diff) | |
download | src-89a828fde94cfb83da985c9d727c28e0bac0b100.tar.gz src-89a828fde94cfb83da985c9d727c28e0bac0b100.zip |
The wakeup() line from the rev. 1.319 is wrong and reintroduces
a panic race on module unload. The wakeup() is internal to
kproc_exit/kthread_exit. The correct fix is to fix the msleep() in
detach to sleep on fdc->fdc_thread instead of &fdc->fdc_thread.
Noted and reviewed by: jhb
Pointy hat to: kib
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=175230
Diffstat (limited to 'sys/dev/fdc/fdc.c')
-rw-r--r-- | sys/dev/fdc/fdc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index df1e629f27af..bcdfcb9067a3 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -1205,7 +1205,6 @@ fdc_thread(void *arg) mtx_lock(&fdc->fdc_mtx); } fdc->flags &= ~(FDC_KTHREAD_EXIT | FDC_KTHREAD_ALIVE); - wakeup(&fdc->fdc_thread); mtx_unlock(&fdc->fdc_mtx); kproc_exit(0); @@ -1721,7 +1720,7 @@ fdc_detach(device_t dev) fdc->flags |= FDC_KTHREAD_EXIT; wakeup(&fdc->head); while ((fdc->flags & FDC_KTHREAD_ALIVE) != 0) - msleep(&fdc->fdc_thread, &fdc->fdc_mtx, PRIBIO, "fdcdet", 0); + msleep(fdc->fdc_thread, &fdc->fdc_mtx, PRIBIO, "fdcdet", 0); mtx_unlock(&fdc->fdc_mtx); /* reset controller, turn motor off */ |