USB device has gone after reboot — only physical reconnection helps

USB device has gone after reboot — only physical reconnection helps

I have a strange serial USB device (ID 17ff:1012) that won't show up anymore after rebooting my hardware until somebody physically unplugs and replugs the device. Since the machine is locate at a remote site, this means that I effectively usually cannot reboot without somebody going there physically.

After a reboot the device will simply not show up in lsusb anymore, and it's interface in /dev/ttyACM0 will be missing.

To get the device back via software, I tried to reset the particular affected device, then to reset the USB root hub and finally to reset the entire PCI device with the USB root hub, all without success. After resetting the USB root hub and the PCI device, an lsusb takes considerably longer to complete. Indeed, dmesg is showing timeouts:

[  711.633658] usb 1-4.3: new full-speed USB device number 3 using xhci_hcd
[  742.875841] usb 1-4.3: new full-speed USB device number 4 using xhci_hcd
[  774.030335] usb 1-4-port3: attempt power cycle
[  774.634110] usb 1-4.3: new full-speed USB device number 5 using xhci_hcd
[  779.730532] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[  785.106902] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[  785.394882] usb 1-4.3: new full-speed USB device number 6 using xhci_hcd
[  790.483298] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[  795.859711] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command

The host machine is an Intel Nuc with an Atom E3826 CPU. It's running a Debian Buster with kernel 5.10.0. The device itself is a serial pager.

lsusb -t

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 480M
    |__ Port 4: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 2: Dev 7, If 0, Class=Communications, Driver=cdc_acm, 12M
        |__ Port 2: Dev 7, If 1, Class=CDC Data, Driver=cdc_acm, 12M

hwinfo --usb

02: USB 00.0: 10200 Modem
  [Created at usb.122]
  SysFS ID: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.2/1-4.2:1.0
  SysFS BusID: 1-4.2:1.0
  Hardware Class: modem
  Model: "Modem"
  Hotplug: USB
  Vendor: usb 0x17ff
  Device: usb 0x1012
  Revision: "10.00"
  Driver: "cdc_acm"
  Driver Modules: "cdc_acm"
  Device File: /dev/ttyACM0
  Device Files: /dev/ttyACM0, /dev/serial/by-path/pci-0000:00:14.0-usb-0:4.2:1.0, /dev/serial/by-id/usb-17ff_1012-if00                                                                           
  Speed: 12 Mbps
  Module Alias: "usb:v17FFp1012d1000dc02dsc00dp00ic02isc02ip01in00"
  Driver Info #0:
    Driver Status: cdc_acm is active
    Driver Activation Cmd: "modprobe cdc_acm"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #4 (Hub)
…
05: USB 00.1: 0000 Unclassified device
  [Created at usb.122]
  SysFS ID: /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.2/1-4.2:1.1
  SysFS BusID: 1-4.2:1.1
  Hardware Class: unknown
  Model: "Unclassified device"
  Hotplug: USB
  Vendor: usb 0x17ff
  Device: usb 0x1012
  Revision: "10.00"
  Driver: "cdc_acm"
  Driver Modules: "cdc_acm"
  Speed: 12 Mbps
  Module Alias: "usb:v17FFp1012d1000dc02dsc00dp00ic0Aisc00ip00in01"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #4 (Hub)
…

Do you have any idea how to work around that issue in software? It would be great to avoid driving there every time I need to restart the device.

Thank you very much for your help!

答案1

Not sure if it helps but had a similar issue on my Raspberry Pi running Debian 11 Bulleye and a USB LTE 4G modem stick. At reboot the usb stick didnt start up. Solved it by changing the boot order in raspi-config so that the Pi tried booting from USB (unsuccessfully) before trying the SD card. Somehow that procedure activated the 4G stick.

答案2

This can also happen in some devices due to the device never loosing power during reboot and malfunctioning in the process of reconnecting. Physical reconnect effectively "reboots" the device. IF you power down the device and disconnect all power, then bring it back up, and it works... Then it is the device itself.

相关内容