freebsd-skq/sys/dev/usb/input
avg 7bd2d75f37 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
..
atp.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
uep.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
uhid.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
ukbd.c ukbd: adjust for SCHEDULER_STOPPED() and overhaul locking code 2011-12-21 11:49:33 +00:00
ums.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
usb_rdesc.h Use my address of the FreeBSD project in the copyright statement in USB2. 2009-02-24 17:10:43 +00:00