diff options
author | alfred <alfred@FreeBSD.org> | 2009-08-24 05:05:38 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2009-08-24 05:05:38 +0000 |
commit | 52d0adc8f68b84e4f3af6d83cf3502ed56aafe3d (patch) | |
tree | d200d383126920559f7a10faf77a906d8a006992 /sys/dev/usb/usb_process.c | |
parent | d1d25e4acf9faef5a904928fe3345533e15d2575 (diff) | |
download | FreeBSD-src-52d0adc8f68b84e4f3af6d83cf3502ed56aafe3d.zip FreeBSD-src-52d0adc8f68b84e4f3af6d83cf3502ed56aafe3d.tar.gz |
- Patch to allow USB controller to resume operation after
being polled.
- Remove the need for Giant from the USB HUB driver.
- Leave device unconfigured instead of disabling the USB port
when Huawei Autoinstall disk detection triggers. This should
fix problems that the Huawei device is not detected after
Autoinstall eject is issued.
- Reported by: Nikolay Antsiferov
- Fix memory use after free race for USB character devices.
- Reported by: Lucius Windschuh
- Factor out the enumeration lock into three functions to make the
coming newbus lock conversion more easy.
- usbd_enum_lock
- usbd_enum_unlock
- usbd_enum_is_locked
Submitted by: hps
Diffstat (limited to 'sys/dev/usb/usb_process.c')
-rw-r--r-- | sys/dev/usb/usb_process.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c index 5b98a81..0810885 100644 --- a/sys/dev/usb/usb_process.c +++ b/sys/dev/usb/usb_process.c @@ -448,3 +448,29 @@ usb_proc_drain(struct usb_process *up) } mtx_unlock(up->up_mtx); } + +/*------------------------------------------------------------------------* + * usb_proc_rewakeup + * + * This function is called to re-wakeup the the given USB + * process. This usually happens after that the USB system has been in + * polling mode, like during a panic. This function must be called + * having "up->up_mtx" locked. + *------------------------------------------------------------------------*/ +void +usb_proc_rewakeup(struct usb_process *up) +{ + /* check if not initialised */ + if (up->up_mtx == NULL) + return; + /* check if gone */ + if (up->up_gone) + return; + + mtx_assert(up->up_mtx, MA_OWNED); + + if (up->up_msleep == 0) { + /* re-wakeup */ + cv_signal(&up->up_cv); + } +} |