]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r305421:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 12 Sep 2016 10:17:25 +0000 (10:17 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 12 Sep 2016 10:17:25 +0000 (10:17 +0000)
commit6cbbe279aa608f2ee03d6d42d104635b44186288
tree9dff2ef4e2e29744eaefd2071f286da8ee786b8b
parent4ad656d970add136b152054f6966fd10a97dbbfd
MFC r305421:
Resolve deadlock between device_detach() and usbd_do_request_flags()
by reviving the SX control request lock and refining which lock
protects the common scratch area in "struct usb_device".

The SX control request lock was removed by r246759 because it caused a
lock order reversal with the USB enumeration lock inside
usbd_transfer_setup() as a function of r246616. It was thought that
reducing the number of locks would resolve the LOR, but because some
USB device drivers use usbd_do_request_flags() inside callback
functions, like in taskqueues, a deadlock may occur when these are
drained from device_detach(). By restoring the SX control request
lock usbd_do_request_flags() is allowed to complete its execution
when a USB device driver is detaching. By using the SX control request
lock to protect the scratch area, the LOR introduced by r246616 is
also resolved.

Bump the FreeBSD version while at it to force recompilation of all USB
kernel modules.

Found by: avos@

git-svn-id: svn://svn.freebsd.org/base/stable/10@305734 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/usb/template/usb_template.c
sys/dev/usb/usb_device.c
sys/dev/usb/usb_device.h
sys/dev/usb/usb_generic.c
sys/dev/usb/usb_request.c
sys/dev/usb/usb_transfer.c
sys/dev/usb/usb_util.c
sys/sys/param.h