]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r305421:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 12 Sep 2016 10:20:44 +0000 (10:20 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 12 Sep 2016 10:20:44 +0000 (10:20 +0000)
commit088b320873707e323321f0190bb43a54bdf0e7c7
treeb36e3bbf558e63d47ef2265a8a86ba12b2ffc3aa
parent2d0d81cbe36c452a21f6a86194ad3d5e7b83ffc9
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/9@305735 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