lsusb hangs forever

Bug #1072278 reported by Fabio Fumi on 2012-10-28
36
This bug affects 8 people
Affects Status Importance Assigned to Milestone
usbutils (Ubuntu)
Undecided
Unassigned

Bug Description

This is a spinoff of Bug 570049, as suggesgted by Dave Gilbert there.

I've been experiencing the same issue on my Ubuntu 11.04 or 12.04 installations. Usb devices suddenly stops working after I plug/unplug some of them. I have a USB-Serial converte and an external SD-card reader and both seem to trigger the problem Only "workaround" is to reboot the system (which is not a solution, obviously). As it looks like from dmesg, the crash of khubd is at the root of the problem, and being a kernel thread can't be "restarted" other than rebooting.

It looks like a common problem, across different distributions.

Both the symptom (lsusb hanging) and what looks like the underlying cause are always the same: a crash of khubd kernel thread is always there, with a similar stack trace in every case, triggered by the same pattern: usb_stor_disconnect -> release_everything -> kthread_stop -> ...

Also attaching a collection of logs from my system. Below the khubd stack trace from dmesg:

42722.411019] Call Trace:
 [42722.411030] [<ffffffff815c85dd>] schedule_timeout+0x26d/0x2e0
 [42722.411038] [<ffffffff810576a3>] ? update_curr+0x103/0x210
 [42722.411044] [<ffffffff815c8099>] wait_for_common+0xd9/0x180
 [42722.411049] [<ffffffff8105f690>] ? default_wake_function+0x0/0x20
 [42722.411056] [<ffffffff815c821d>] wait_for_completion+0x1d/0x20
 [42722.411061] [<ffffffff810879e2>] kthread_stop+0x42/0xf0
 [42722.411068] [<ffffffffa02375fe>] release_everything+0x2e/0xb0 [usb_storage]
 [42722.411074] [<ffffffffa02384ca>] usb_stor_disconnect+0x2a/0x40 [usb_storage]
 [42722.411081] [<ffffffff8144464a>] usb_unbind_interface+0x5a/0x1a0
 [42722.411089] [<ffffffff813bb305>] __device_release_driver+0x75/0xe0
 [42722.411093] [<ffffffff813bb39d>] device_release_driver+0x2d/0x40
 [42722.411097] [<ffffffff813bae4b>] bus_r...

Fabio Fumi (ffumi68) wrote :
Fabio Fumi (ffumi68) wrote :

Found this patch discussion:

 https://patchwork.kernel.org/patch/1251681/

which looks relevant for this issue, I think.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in usbutils (Ubuntu):
status: New → Confirmed
Chronos (chronos00) wrote :

Sorry for reviving an old bug report.

I have bumped into the same problem. Before I reboot, and loose the posibility to run traces, I would like to attach them to help debug this.

Felix Moreno (info-justdust) wrote :

the bug is still there, it happens to me when plugging a samsung s2 phone to the usb in download mode... it freezes till i remove the wire and then it finish the lsusb command, i saw the same bug at ubuntu 15.10
http://ubuntuforums.org/showthread.php?t=2301619
Even if there is a usb faulty thing, it should not freeze, but my phone is not fwaulty.

The bug is still there in Ubuntu 16.04

strace lsusb

read(6, "MAJOR=189\nMINOR=128\nDEVNAME=bus/"..., 4096) = 126
read(6, "", 4096) = 0
read(6, "", 4096) = 0
close(6) = 0
getrandom("\210\215\f\212\365Aik\207\204b\t\25v?\330", 16, GRND_NONBLOCK) = 16
getrandom("\206<>\362?\3478W\266\251\370:9\0063\30", 16, GRND_NONBLOCK) = 16
open("/sys/bus/usb/devices/usb2/busnum", O_RDONLY) = 6
fstat(6, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
read(6, "2\n", 4096) = 2
close(6) = 0
open("/sys/bus/usb/devices/usb2/devnum", O_RDONLY) = 6
fstat(6, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
read(6, "1\n", 4096) = 2
close(6) = 0
open("/sys/bus/usb/devices/usb2/speed", O_RDONLY) = 6
fstat(6, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
read(6, "480\n", 4096) = 4
close(6) = 0
open("/sys/bus/usb/devices/usb2/descriptors", O_RDONLY) = 6
read(6,

but it does not get stuck forever, just a looong time. ~1 minute.
sometimes i get a "unable to mount Android" error notification window after several minutes. sometimes nothing. when lsusb is done after ~1 minute i wont see my phone listed.
Have tried several times on both ports on my laptop.

hmm. while writing this post, my phone suddenly mounted and showed up in lsusb.. hmm magic?

this does not look good.
[ 983.014897] usb 2-2: new high-speed USB device number 79 using xhci_hcd
[ 988.719212] usb 2-2: new high-speed USB device number 81 using xhci_hcd
[ 994.047456] usb 2-2: new high-speed USB device number 82 using xhci_hcd
[ 999.343739] usb 2-2: new high-speed USB device number 83 using xhci_hcd
[ 1005.088013] usb 2-2: new high-speed USB device number 86 using xhci_hcd
[ 1010.384266] usb 2-2: new high-speed USB device number 87 using xhci_hcd
[ 1015.684524] usb 2-2: new high-speed USB device number 88 using xhci_hcd
[ 1020.980840] usb 2-2: new high-speed USB device number 89 using xhci_hcd
[ 1021.110713] usb 2-2: New USB device found, idVendor=04e8, idProduct=6860
[ 1021.110716] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1021.110718] usb 2-2: Product: SAMSUNG_Android
[ 1021.110719] usb 2-2: Manufacturer: SAMSUNG
[ 1021.110720] usb 2-2: SerialNumber: 290fc46c
[ 1021.644871] cdc_acm 2-2:1.1: ttyACM0: USB ACM device
[ 1021.645785] usbcore: registered new interface driver cdc_acm
[ 1021.645788] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1024.306555] usb 2-2: USB disconnect, device number 89
[ 1024.306806] cdc_acm 2-2:1.1: failed to set dtr/rts
[ 1024.580980] usb 2-2: new high-speed USB device number 90 using xhci_hcd
[ 1024.710038] usb 2-2: New USB device found, idVendor=04e8, idProduct=6860
[ 1024.710041] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1024.710043] usb 2-2: Product: SAMSUNG_Android
[ 1024.710044] usb 2-2: Manufacturer: SAMSUNG
[ 1024.710045] usb 2-2: SerialNumber: 290fc46c
[ 1024.711491] cdc_acm 2-2:1.1: ttyACM0: USB ACM device
[ 1025.133224] usb 2-2: USB disconnect, device number 90
[ 1025.621029] usb 2-2: new high-speed USB device number 92 using xhci_hcd
[ 1025.949086] usb 2-2: new high-speed USB device number 93 using xhci_hcd
[ 1031.245312] usb 2-2: new high-speed USB device number 94 using xhci_hcd
[ 1031.374588] usb 2-2: New USB device found, idVendor=04e8, idProduct=6860
[ 1031.374591] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1031.374592] usb 2-2: Product: SAMSUNG_Android
[ 1031.374593] usb 2-2: Manufacturer: SAMSUNG
[ 1031.374594] usb 2-2: SerialNumber: 290fc46c
[ 1031.375471] cdc_acm 2-2:1.1: ttyACM0: USB ACM device
[ 1245.592672] usb 2-2: USB disconnect, device number 94
[ 1245.866958] usb 2-2: new high-speed USB device number 95 using xhci_hcd
[ 1251.163122] usb 2-2: new high-speed USB device number 96 using xhci_hcd
[ 1256.459429] usb 2-2: new high-speed USB device number 97 using xhci_hcd

can it be auto suspend on the USB port?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers