Apart from the early exploration done to find a console keyboard during
authormpi <mpi@openbsd.org>
Wed, 28 May 2014 11:20:55 +0000 (11:20 +0000)
committermpi <mpi@openbsd.org>
Wed, 28 May 2014 11:20:55 +0000 (11:20 +0000)
commitd7fb47546222cf4514e93c2ab60a85be97c2b540
tree6e0e5f2c787f5358d97ccc8088fae2650a938b3c
parent1f4ada3fcf172c25177fc248e2f28c97a18ec343
Apart from the early exploration done to find a console keyboard during
the boot process, USB devices must be attached or detached from the usb
task thread in order to avoid races with periodical explorations issued
by uhub(4) interrupts.

Respect this rule when detaching root hubs during a suspend/resume cycle
and avoid some hangs due to the aforementioned race.

Tested by Mattieu Baptiste, thanks!
sys/dev/usb/uhub.c
sys/dev/usb/usb.c
sys/dev/usb/usbdivar.h