Bug 202275 - USB SX lock hang involving sound devices
Summary: USB SX lock hang involving sound devices
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 10.2-BETA1
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-12 20:17 UTC by John Hood
Modified: 2015-08-12 20:34 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Hood 2015-08-12 20:17:14 UTC
FreeBSD 10.2-RC2

I think something in the USB or audio stack has a USB locking issue.  I think this duplicates Bug 194727.

I had a strange USB hang this afternoon.  I took a little nap, and my display went to sleep (this is important, see below).  On waking and returning to my computer, my two USB mice were hung, but a USB keyboard and a Bluetooth keyboard connected via a USB host controller continued to work.

Investigation found this appearing in /var/log/messages every 2-3 seconds:

Aug 12 15:38:54 lister kernel: pcm6: unregister: mixer busy
Aug 12 15:38:54 lister kernel: pcm6: Waiting for sound application to exit!

I ran 'usbconfig -l', it hung.  ^T revealed it was waiting on [USB config SX lock].

I finally discovered a couple of instances of kdeinit4 that had /dev/mixer6 open.  Killing them caused the messages to stop, the USB stack to recover, and my mice started working again.

I have a Dell P2815Q monitor with USB3 hub attached to my system.  Plugged into that is an old Microsoft USB webcam.  This webcam's uaudio0 device was attached to pcm6.  The monitor is set to an energy save mode where it powers down the hub when it goes to sleep, and my system log shows the hub and webcam disconnecting and reconnecting frequently.  It also has some firmware issues that sometimes require you to do a hard power cycle by holding the power button down for 4s, I don't remember if I had to do that this time.

I do not know what is going on exactly, but this all suggests that something may be inappropriately holding that USB lock while waiting for a process during device teardown and causing other non-sound-related devices to hang.  Fortunately, my keyboards continued to work in this case.
Comment 1 John Hood 2015-08-12 20:34:04 UTC
ugen2.1: <OHCI root HUB ATI> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen1.1: <XHCI root HUB 0x1b21> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.1: <XHCI root HUB 0x1b21> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen5.1: <EHCI root HUB ATI> at usbus5, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen4.1: <OHCI root HUB ATI> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen3.1: <EHCI root HUB ATI> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen7.1: <OHCI root HUB ATI> at usbus7, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen6.1: <OHCI root HUB ATI> at usbus6, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen8.1: <EHCI root HUB ATI> at usbus8, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen3.2: <product 0x0234 vendor 0x050d> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (100mA)
ugen2.2: <Comfort Curve Keyboard 2000 Microsoft> at usbus2, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (100mA)
ugen2.3: <BELKIN BLUETOOTH USB ADAPTER CL. 2 Broadcom Corp> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen8.2: <Pioneer external optical drive Pioneer Corporation> at usbus8, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (2mA)
ugen4.2: <product 0x2046 vendor 0x0451> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen4.3: <Razer DeathAdder Razer> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen4.4: <USB Gaming Mouse Logitech> at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (98mA)
ugen1.3: <product 0x8044 vendor 0x0451> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <product 0x8046 vendor 0x0451> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.4: <Microsoft LifeCam-VX700  v2.0 Microsoft> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (168mA)