Present Location: News >> Blog >> Linux USB Identifiers and Error Messages

Blog

> Linux USB Identifiers and Error Messages
Posted by prox, from Seattle, on April 14, 2018 at 20:38 local (server) time

It took me a few minutes to track this down, so I figured I'd share it with the world.

In the event of a USB error or warning, the Linux kernel will print a message like the following:

[15740840.830734] usb 2-3: Failed to suspend device, error -71

Most of us have a ton of USB-connected devices, so how does one figure out what "usb 2-3" refers to in order to diagnose the problem?  At first, I thought lsusb(8) would help:

(atlantis:17:29:PDT)% lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 010 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 009 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 003: ID 0bc2:5031 Seagate RSS LLC FreeAgent GoFlex USB 3.0
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0409:0058 NEC Corp. HighSpeed Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 006 Device 004: ID 1781:0a98 Multiple Vendors raphnet.net USBTenki
Bus 006 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 006 Device 002: ID 0451:2046 Texas Instruments, Inc. TUSB2046 Hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

That's nice, but I don't see bus number 2 and device number 3 or bus number 3 and device number 2 in that list. The verbose (-v) flag doesn't appear to help, either.  So, I try usb-devices(1) and am presented with even more information, like this for each device:

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 6
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=04.13
S:  Manufacturer=Linux 4.13.0-1-amd64 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=0000:00:1a.7
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

I still couldn't find a combination of 2-3 or 3-2 in there.  So, I started hunting around sysfs for an answer, and ended up finding it:

(atlantis:17:35:PDT)% cd /sys/bus/usb/devices/2-3                 
(atlantis:17:35:PDT)% lsusb|grep $(cat idVendor):$(cat idProduct)
Bus 002 Device 002: ID 2109:2812 VIA Labs, Inc. VL812 Hub

For some reason, lsusb(8) doesn't feel like displaying the what I learned is the device number and device path:

(atlantis:17:35:PDT)% echo $(cat devnum)-$(cat devpath)          
2-3

Although, I have three "hubs" connected to this machine, so tracking those down is another story.  At least I know what I'm looking for, now.

> Add Comment

New comments are currently disabled for this entry.