freebsd-src/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 Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
net Another axe(4), found in ASUS zenbook. 2011-12-17 15:38:16 +00:00
quirk Add quirk for Micron RealSSD eUSB failing on unsupported SCSI command 2011-12-03 19:56:52 +00:00
serial kern cons: introduce infrastructure for console grabbing by kernel 2011-12-17 15:08:43 +00:00
storage Enable power save mode for the USB storage device driver. 2011-11-12 08:19:36 +00:00
template Correct some bInterval USB template descriptor values. 2011-12-06 08:08:52 +00:00
wlan Fix some net80211 enum nits: 2011-12-17 10:23:17 +00:00
ufm_ioctl.h
usb.h Fix size of USB 3.0 descriptor field. 2011-11-09 18:48:36 +00:00
usb_bus.h Implement better support for USB controller suspend and resume. 2011-12-14 00:28:54 +00:00
usb_busdma.c Style change. 2011-11-12 08:16:45 +00:00
usb_busdma.h
usb_cdc.h USB network (NCM driver): 2010-10-13 22:04:55 +00:00
usb_compat_linux.c Style change. 2011-11-12 08:16:45 +00:00
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 Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_core.h
usb_debug.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_debug.h Change USB_DEBUG to #ifdef and allow it to be turned off. Previously this had 2010-04-22 21:31:34 +00:00
usb_dev.c Style change. 2011-11-12 08:16:45 +00:00
usb_dev.h
usb_device.c Improve USB mass storage quirk auto detection. 2011-10-29 12:32:13 +00:00
usb_device.h This patch adds automatic detection of USB mass storage devices 2011-09-02 18:50:44 +00:00
usb_dynamic.c Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usb_dynamic.h Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usb_endian.h
usb_error.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_freebsd.h This patch adds automatic detection of USB mass storage devices 2011-09-02 18:50:44 +00:00
usb_generic.c Style change. 2011-11-12 08:16:45 +00:00
usb_generic.h
usb_handle_request.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_hid.c Make the USB keyboard driver more HID compliant. 2011-07-04 07:37:28 +00:00
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 This commit adds full support for USB 3.0 devices in host and device 2010-10-04 23:18:05 +00:00
usb_if.m Implement better support for USB controller suspend and resume. 2011-12-14 00:28:54 +00:00
usb_ioctl.h - This patch adds custom IOCTLs to read and write the 4 GPIO pins on the 2011-11-12 08:40:52 +00:00
usb_lookup.c - Export the USB device ID format to userspace tools. 2011-06-25 15:51:44 +00:00
usb_mbuf.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_mbuf.h
usb_msctest.c Fix a compile warning with clang. 2011-12-03 14:54:44 +00:00
usb_msctest.h This patch adds automatic detection of USB mass storage devices 2011-09-02 18:50:44 +00:00
usb_parse.c Remove unneeded includes of <sys/linker_set.h>. Other headers that use 2011-01-11 13:59:06 +00:00
usb_pci.h
usb_pf.c - Improvements to USB PF solution 2011-04-03 20:03:45 +00:00
usb_pf.h - Improvements to USB PF solution 2011-04-03 20:03:45 +00:00
usb_process.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
usb_process.h Use software interrupt priorities for USB kthreads instead of hardware 2011-01-13 14:15:36 +00:00
usb_request.c Style change. 2011-11-12 08:16:45 +00:00
usb_request.h Improve enumeration of Low- and Full-speed devices connected through a 2011-06-06 21:45:09 +00:00
usb_transfer.c adapt usb transfer code for SCHEDULER_STOPPED 2011-12-21 10:52:17 +00:00
usb_transfer.h This commit marks the beginning of a new internal USB 2011-11-28 09:54:41 +00:00
usb_util.c Simplify the usb_pause_mtx() function by factoring out the generic parts 2011-11-19 11:17:27 +00:00
usb_util.h Move the device_delete_all_children() function from usb_util.c 2011-11-19 10:11:50 +00:00
usbdevs Another axe(4), found in ASUS zenbook. 2011-12-17 15:38:16 +00:00
usbdi.h Refactor auto-quirk solution so that we break as few external 2011-09-10 15:55:36 +00:00
usbdi_util.h This commit adds full support for USB 3.0 devices in host and device 2010-10-04 23:18:05 +00:00
usbhid.h Make the USB keyboard driver more HID compliant. 2011-07-04 07:37:28 +00:00