freebsd-skq/sys/dev/usb/template
Hans Petter Selasky 64cb5e2a26 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@
MFC after:	1 week
2016-09-05 15:35:58 +00:00
..
usb_template_audio.c
usb_template_cdce.c
usb_template_kbd.c
usb_template_midi.c
usb_template_modem.c
usb_template_mouse.c
usb_template_msc.c
usb_template_mtp.c
usb_template_phone.c
usb_template_serialnet.c
usb_template.c Resolve deadlock between device_detach() and usbd_do_request_flags() 2016-09-05 15:35:58 +00:00
usb_template.h