freebsd-dev/sys/dev/usb
Andriy Gapon bc40a96992 ukbd: adjust for SCHEDULER_STOPPED() and overhaul locking code
This change is designed to let USB keyboard work in the panic context
with stop_scheduler_on_panic=1.  Most of change consists of removing
mtx_owned() checks where they can be easily avoided.  Some additional
lock cleanup is performed along the way.

A list of the smaller changes:
- newbus methods should be executed with Giant already held, just assert
  this
- kbd methods called in the non-polling context should be executed with
  Giant already held, just assert this
- Giant is recursive, so we should just take it where we must have it,
  without redundant checks if we already have it
- thanks to recent syscons changes we don't need to go through the hoops
  to detect if kernel is going to poll us; polling mode is now clearly
  separated from non-polling mode
- at present the polling mode can be entered by only one thread
- document special cases in greater detail

Please note that the ukbd code and underlying USB code still lve
dangerously in the kdb context by trying to obtain various locks
including the Giant.  If any of those locks are already held by the
stopped threads, then the things would blow up.
Another limitation of the ukbd driver is that it is detached before a
system enters the halt state.

With this commit we can enable kern.stop_scheduler_on_panic by default,
that should not introduce any regressions.

Reviewed by:	hselasky
MFC after:	3 months
X-MFC after:	r228424, r228760
2011-12-21 11:49:33 +00:00
..
controller Make the recently added "no_shutdown_wait" sysctl writeable. 2011-12-19 23:39:08 +00:00
input ukbd: adjust for SCHEDULER_STOPPED() and overhaul locking code 2011-12-21 11:49:33 +00:00
misc
net Another axe(4), found in ASUS zenbook. 2011-12-17 15:38:16 +00:00
quirk
serial kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
storage
template
wlan Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
ufm_ioctl.h
usb_bus.h Implement better support for USB controller suspend and resume. 2011-12-14 00:28:54 +00:00
usb_busdma.c
usb_busdma.h
usb_cdc.h
usb_compat_linux.c
usb_compat_linux.h
usb_controller.h Implement better support for USB controller suspend and resume. 2011-12-14 00:28:54 +00:00
usb_core.c
usb_core.h
usb_debug.c
usb_debug.h
usb_dev.c
usb_dev.h
usb_device.c
usb_device.h
usb_dynamic.c
usb_dynamic.h
usb_endian.h
usb_error.c
usb_freebsd.h
usb_generic.c
usb_generic.h
usb_handle_request.c
usb_hid.c
usb_hub.c Fix for race against user-space applications trying to change the 2011-12-21 08:46:08 +00:00
usb_hub.h
usb_if.m Implement better support for USB controller suspend and resume. 2011-12-14 00:28:54 +00:00
usb_ioctl.h
usb_lookup.c
usb_mbuf.c
usb_mbuf.h
usb_msctest.c
usb_msctest.h
usb_parse.c
usb_pci.h
usb_pf.c
usb_pf.h
usb_process.c
usb_process.h
usb_request.c
usb_request.h
usb_transfer.c adapt usb transfer code for SCHEDULER_STOPPED 2011-12-21 10:52:17 +00:00
usb_transfer.h
usb_util.c
usb_util.h
usb.h
usbdevs Another axe(4), found in ASUS zenbook. 2011-12-17 15:38:16 +00:00
usbdi_util.h
usbdi.h
usbhid.h