]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/commit
MFC r305421:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 12 Sep 2016 10:23:24 +0000 (10:23 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 12 Sep 2016 10:23:24 +0000 (10:23 +0000)
commitd1972bd716d9753f943be50ed0ded6c8270bef5a
tree64e3525d79fe726c986f2905b364bd348e12e0b8
parent824642c21754d474d2267ba2db7ff3b9f4f8aa90
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/8@305736 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