How to reset USB port

I have a RockPi 4B

I noticed that following a reboot (cold or hot), sometimes the USB devices plugged into the USB port does not work any more. lsusb shows that no devices are connected to the port. To get it working I need to un-plug and re-plug the USB device, which always works after the system boots. But if I leave the device plugged in, even if I reboot many times, it may or may not connect.

I am using Debian 11, with https://radxa-repo.github.io/bsp/ compiled latest u-boot and stable linux headers.

I applied u-boot-latest_2023.10-1_arm64.deb and the linux stable .deb files.

Can anyone tell me why, and how can I reset the port / USB hub controller programmatically?

successful connects on boot:
[ 0.587765] usbcore: registered new interface driver usbfs
[ 0.587967] usbcore: registered new interface driver hub
[ 0.588118] usbcore: registered new device driver usb
[ 4.963470] usbcore: registered new interface driver usbhid
[ 4.963518] usbhid: USB HID core driver
[ 5.292753] usb usb2: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 5.376947] usb usb4: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 5.395698] ehci-platform fe380000.usb: EHCI Host Controller
[ 5.395823] ehci-platform fe380000.usb: new USB bus registered, assigned bus number 5
[ 5.396244] ehci-platform fe380000.usb: irq 58, io mem 0xfe380000
[ 5.402684] ehci-platform fe3c0000.usb: EHCI Host Controller
[ 5.402879] ehci-platform fe3c0000.usb: new USB bus registered, assigned bus number 6
[ 5.403312] ehci-platform fe3c0000.usb: irq 59, io mem 0xfe3c0000
[ 5.404660] ohci-platform fe3a0000.usb: Generic Platform OHCI controller
[ 5.404754] ohci-platform fe3a0000.usb: new USB bus registered, assigned bus number 7
[ 5.405167] ohci-platform fe3a0000.usb: irq 60, io mem 0xfe3a0000
[ 5.411303] ehci-platform fe380000.usb: USB 2.0 started, EHCI 1.00
[ 5.413269] ohci-platform fe3e0000.usb: Generic Platform OHCI controller
[ 5.416724] ohci-platform fe3e0000.usb: new USB bus registered, assigned bus number 8
[ 5.417117] ohci-platform fe3e0000.usb: irq 71, io mem 0xfe3e0000
[ 5.431097] ehci-platform fe3c0000.usb: USB 2.0 started, EHCI 1.00
[ 6.926946] usb 6-1: new high-speed USB device number 2 using ehci-platform
[ 18.966667] usbcore: registered new interface driver snd-usb-audio

Unsuccessful connects on boot
[ 0.585399] usbcore: registered new interface driver usbfs
[ 0.585584] usbcore: registered new interface driver hub
[ 0.585740] usbcore: registered new device driver usb
[ 5.042243] usbcore: registered new interface driver usbhid
[ 5.042542] usbhid: USB HID core driver
[ 5.370442] usb usb2: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 5.455326] usb usb4: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 5.474277] ehci-platform fe380000.usb: EHCI Host Controller
[ 5.474399] ehci-platform fe380000.usb: new USB bus registered, assigned bus number 5
[ 5.474807] ehci-platform fe380000.usb: irq 58, io mem 0xfe380000
[ 5.481308] ehci-platform fe3c0000.usb: EHCI Host Controller
[ 5.481455] ehci-platform fe3c0000.usb: new USB bus registered, assigned bus number 6
[ 5.481843] ehci-platform fe3c0000.usb: irq 59, io mem 0xfe3c0000
[ 5.482644] ohci-platform fe3a0000.usb: Generic Platform OHCI controller
[ 5.482677] ohci-platform fe3a0000.usb: new USB bus registered, assigned bus number 7
[ 5.482842] ohci-platform fe3a0000.usb: irq 60, io mem 0xfe3a0000
[ 5.489472] ehci-platform fe380000.usb: USB 2.0 started, EHCI 1.00
[ 5.492496] ohci-platform fe3e0000.usb: Generic Platform OHCI controller
[ 5.493817] ohci-platform fe3e0000.usb: new USB bus registered, assigned bus number 8
[ 5.494414] ohci-platform fe3e0000.usb: irq 71, io mem 0xfe3e0000
[ 5.505053] ehci-platform fe3c0000.usb: USB 2.0 started, EHCI 1.00
[ 5.761159] usb 6-1: new high-speed USB device number 2 using ehci-platform
[ 11.133092] usb 6-1: device descriptor read/64, error -110
[ 21.637094] usb 6-1: device descriptor read/64, error -71
[ 21.873096] usb 6-1: new high-speed USB device number 3 using ehci-platform
[ 22.033097] usb 6-1: device descriptor read/64, error -71
[ 22.301098] usb 6-1: device descriptor read/64, error -71
[ 22.409230] usb usb6-port1: attempt power cycle
[ 22.821097] usb 6-1: new high-speed USB device number 4 using ehci-platform
[ 23.253090] usb 6-1: device not accepting address 4, error -71
[ 23.381098] usb 6-1: new high-speed USB device number 5 using ehci-platform
[ 23.813090] usb 6-1: device not accepting address 5, error -71
[ 23.813965] usb usb6-port1: unable to enumerate USB device
[ 24.212919] usb 8-1: new full-speed USB device number 2 using ohci-platform
[ 24.412900] usb 8-1: device descriptor read/64, error -62
[ 24.712986] usb 8-1: device descriptor read/64, error -62
[ 25.008904] usb 8-1: new full-speed USB device number 3 using ohci-platform
[ 25.200962] usb 8-1: device descriptor read/64, error -62
[ 25.501031] usb 8-1: device descriptor read/64, error -62
[ 25.609195] usb usb8-port1: attempt power cycle
[ 25.829178] usb 8-1: new full-speed USB device number 4 using ohci-platform
[ 26.245023] usb 8-1: device not accepting address 4, error -62
[ 26.432901] usb 8-1: new full-speed USB device number 5 using ohci-platform
[ 26.848988] usb 8-1: device not accepting address 5, error -62
[ 26.849917] usb usb8-port1: unable to enumerate USB device

Can you tell me the hardware version the ROCK 4B you have? And please also tell me the image you use now.

Hi, ROCK PI 4 v1.52, RK3399, the default Debian 10 OS does not boot on this version
(https://github.com/radxa-build/rock-pi-4b/releases/download/main-df04b3af/rockpi-4b-debian-buster-xfce4-arm64-20220401-0335-gpt.img.xz)
so I used default Debian 11 OS (https://github.com/radxa-build/rock-pi-4b/releases/download/20230427-1720/rock-pi-4b_debian_bullseye_kde_b30.img.xz), and noticed the same issue with and without the update to the u-boot.

The linux 6.1 system for rock-4b is coming out soon, you can wait for this new release, or try the rock 4se 5.10 image: https://github.com/radxa-build/rock-4se/releases/download/b38/rock-4se_debian_bullseye_kde_b38.img.xz.

1 Like

Ok I will try that tomorrow, can you tell me roughly when the 6.1 for rock-4b is coming?

For 6.1, you can follow the merging of u-boot and kernel.

Hi, I tried the rock 4se 5.10 image and it has the same issue. After the device boots, I can plug / remove / plug it many times and it always initializes properly. I suspect maybe the Depth Sensor takes too long to initialize at the beginning when the board is first powered. Is it possible to restart the USB interface / delay starting the USB interface until the system initializes for 20 seconds?

We observe similar behaviour on 4B+ with USB thermal cameras. Sometimes, randomly, when camera is disconnected and reconnected several times, the specific USB port dies and it does not recognize any new device until reboot. The other USB ports continue to work.

We tried using a USB hub but it still doesn’t connect, again after it boots, we can plug / unplug as many times and it would connect, only if it is plugged in during boot that it doesn’t connect.

The device is unplugged and plugged in at ~180 seconds.

radxa@rock-pi-4b:~$ sudo dmesg | grep usb
[ 61.478098] usbcore: registered new interface driver usbfs
[ 61.478136] usbcore: registered new interface driver hub
[ 61.478174] usbcore: registered new device driver usb
[ 63.157229] rockchip-usb2phy ff770000.syscon:usb2-phy@e450: IRQ index 0 not found
[ 63.157431] phy phy-ff770000.syscon:usb2-phy@e450.1: Looking up phy-supply from device tree
[ 63.157558] vcc5v0_host: could not add device link phy-ff770000.syscon:usb2-phy@e450.1: -ENOENT
[ 63.158070] phy phy-ff770000.syscon:usb2-phy@e450.2: Looking up phy-supply from device tree
[ 63.158091] vcc5v0_typec: could not add device link phy-ff770000.syscon:usb2-phy@e450.2: -ENOENT
[ 63.158258] phy phy-ff770000.syscon:usb2-phy@e450.2: Looking up vbus-supply from device tree
[ 63.158276] phy phy-ff770000.syscon:usb2-phy@e450.2: Looking up vbus-supply property in node /syscon@ff770000/usb2-phy@e450/otg-port failed
[ 63.160198] rockchip-usb2phy ff770000.syscon:usb2-phy@e460: IRQ index 0 not found
[ 63.160371] phy phy-ff770000.syscon:usb2-phy@e460.3: Looking up phy-supply from device tree
[ 63.160397] vcc5v0_host: could not add device link phy-ff770000.syscon:usb2-phy@e460.3: -ENOENT
[ 63.160842] phy phy-ff770000.syscon:usb2-phy@e460.4: Looking up phy-supply from device tree
[ 63.160862] phy phy-ff770000.syscon:usb2-phy@e460.4: Looking up phy-supply property in node /syscon@ff770000/usb2-phy@e460/otg-port failed
[ 63.160954] phy phy-ff770000.syscon:usb2-phy@e460.4: Looking up vbus-supply from device tree
[ 63.160971] phy phy-ff770000.syscon:usb2-phy@e460.4: Looking up vbus-supply property in node /syscon@ff770000/usb2-phy@e460/otg-port failed
[ 63.165385] phy phy-ff7c0000.phy.10: Looking up phy-supply property in node /phy@ff7c0000/usb3-port failed
[ 63.165958] phy phy-ff800000.phy.12: Looking up phy-supply property in node /phy@ff800000/usb3-port failed
[ 64.077491] usbcore: registered new interface driver rndis_wlan
[ 64.077532] usbcore: registered new interface driver cdc_ether
[ 64.077564] usbcore: registered new interface driver rndis_host
[ 64.091575] ehci-platform fe380000.usb: EHCI Host Controller
[ 64.091599] ehci-platform fe380000.usb: new USB bus registered, assigned bus number 1
[ 64.091727] ehci-platform fe380000.usb: irq 39, io mem 0xfe380000
[ 64.101965] ehci-platform fe380000.usb: USB 2.0 started, EHCI 1.00
[ 64.102189] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 64.102198] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 64.102206] usb usb1: Product: EHCI Host Controller
[ 64.102213] usb usb1: Manufacturer: Linux 5.10.110-6-rockchip ehci_hcd
[ 64.102219] usb usb1: SerialNumber: fe380000.usb
[ 64.105466] ehci-platform fe3c0000.usb: EHCI Host Controller
[ 64.105486] ehci-platform fe3c0000.usb: new USB bus registered, assigned bus number 2
[ 64.105595] ehci-platform fe3c0000.usb: irq 41, io mem 0xfe3c0000
[ 64.118628] ehci-platform fe3c0000.usb: USB 2.0 started, EHCI 1.00
[ 64.118848] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 64.118857] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 64.118864] usb usb2: Product: EHCI Host Controller
[ 64.118871] usb usb2: Manufacturer: Linux 5.10.110-6-rockchip ehci_hcd
[ 64.118878] usb usb2: SerialNumber: fe3c0000.usb
[ 64.120281] ohci-platform fe3a0000.usb: Generic Platform OHCI controller
[ 64.120299] ohci-platform fe3a0000.usb: new USB bus registered, assigned bus number 3
[ 64.120397] ohci-platform fe3a0000.usb: irq 40, io mem 0xfe3a0000
[ 64.179469] usb usb3: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.10
[ 64.179478] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 64.179485] usb usb3: Product: Generic Platform OHCI controller
[ 64.179492] usb usb3: Manufacturer: Linux 5.10.110-6-rockchip ohci_hcd
[ 64.179498] usb usb3: SerialNumber: fe3a0000.usb
[ 64.180532] ohci-platform fe3e0000.usb: Generic Platform OHCI controller
[ 64.180551] ohci-platform fe3e0000.usb: new USB bus registered, assigned bus number 4
[ 64.180642] ohci-platform fe3e0000.usb: irq 42, io mem 0xfe3e0000
[ 64.239476] usb usb4: New USB device found, idVendor=1d6b, idProduct=0001, bcdDevice= 5.10
[ 64.239485] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 64.239493] usb usb4: Product: Generic Platform OHCI controller
[ 64.239500] usb usb4: Manufacturer: Linux 5.10.110-6-rockchip ohci_hcd
[ 64.239506] usb usb4: SerialNumber: fe3e0000.usb
[ 64.241111] phy phy-ff770000.syscon:usb2-phy@e460.4: illegal mode
[ 64.241650] usb usb5: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[ 64.241660] usb usb5: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 64.241667] usb usb5: Product: xHCI Host Controller
[ 64.241673] usb usb5: Manufacturer: Linux 5.10.110-6-rockchip xhci-hcd
[ 64.241680] usb usb5: SerialNumber: xhci-hcd.3.auto
[ 64.242609] usb usb6: We don’t know the algorithms for LPM for this host, disabling LPM.
[ 64.242744] usb usb6: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[ 64.242752] usb usb6: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 64.242759] usb usb6: Product: xHCI Host Controller
[ 64.242766] usb usb6: Manufacturer: Linux 5.10.110-6-rockchip xhci-hcd
[ 64.242772] usb usb6: SerialNumber: xhci-hcd.3.auto
[ 64.244452] usbcore: registered new interface driver usbtouchscreen
[ 64.281284] usbcore: registered new interface driver uvcvideo
[ 64.300154] usbcore: registered new interface driver usbhid
[ 64.301107] usbhid: USB HID core driver
[ 64.368813] usb 2-1: new high-speed USB device number 2 using ehci-platform
[ 64.492080] usb 5-1: new low-speed USB device number 2 using xhci-hcd
[ 64.517899] usb 2-1: New USB device found, idVendor=2109, idProduct=2817, bcdDevice= 7.00
[ 64.517910] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 64.517918] usb 2-1: Product: USB2.0 Hub
[ 64.517926] usb 2-1: Manufacturer: VIA Labs, Inc.
[ 64.591968] usb 3-1: new low-speed USB device number 2 using ohci-platform
[ 64.641789] usb 5-1: New USB device found, idVendor=046d, idProduct=c315, bcdDevice=28.00
[ 64.641805] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 64.641813] usb 5-1: Product: Logitech USB Keyboard
[ 64.641821] usb 5-1: Manufacturer: Logitech
[ 64.664950] input: Logitech Logitech USB Keyboard as /devices/platform/usb@fe900000/fe900000.usb/xhci-hcd.3.auto/usb5/5-1/5-1:1.0/0003:046D:C315.0001/input/input0
[ 64.719476] hid-generic 0003:046D:C315.0001: input,hidraw0: USB HID v1.10 Keyboard [Logitech Logitech USB Keyboard] on usb-xhci-hcd.3.auto-1/input0
[ 64.814021] usb 3-1: New USB device found, idVendor=04b3, idProduct=310c, bcdDevice= 2.00
[ 64.814032] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 64.814040] usb 3-1: Product: USB Optical Mouse
[ 64.821906] input: USB Optical Mouse as /devices/platform/fe3a0000.usb/usb3/3-1/3-1:1.0/0003:04B3:310C.0002/input/input1
[ 64.878872] hid-generic 0003:04B3:310C.0002: input,hidraw1: USB HID v1.11 Mouse [USB Optical Mouse] on usb-fe3a0000.usb-1/input0
[ 65.225434] usb 2-1.2: new high-speed USB device number 3 using ehci-platform
[ 70.508789] usb 2-1.2: device descriptor read/64, error -110
[ 80.968796] usb 2-1.2: device descriptor read/64, error -71
[ 81.198676] usb 2-1.2: new high-speed USB device number 4 using ehci-platform
[ 81.331998] usb 2-1.2: device descriptor read/64, error -71
[ 81.572009] usb 2-1.2: device descriptor read/64, error -71
[ 81.678964] usb 2-1-port2: attempt power cycle
[ 83.191991] usb 2-1.2: new high-speed USB device number 5 using ehci-platform
[ 83.611992] usb 2-1.2: device not accepting address 5, error -71
[ 83.735301] usb 2-1.2: new high-speed USB device number 6 using ehci-platform
[ 84.155325] usb 2-1.2: device not accepting address 6, error -71
[ 84.156580] usb 2-1-port2: unable to enumerate USB device
[ 84.282003] usb 2-1.3: new high-speed USB device number 7 using ehci-platform
[ 84.429615] usb 2-1.3: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
[ 84.429641] usb 2-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 84.429660] usb 2-1.3: Product: USB 2.0 Hub
[ 84.508658] usb 2-1.5: new high-speed USB device number 8 using ehci-platform
[ 84.607577] usb 2-1.5: New USB device found, idVendor=2109, idProduct=8817, bcdDevice= 0.01
[ 84.607604] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 84.607623] usb 2-1.5: Product: USB Billboard Device
[ 84.607641] usb 2-1.5: Manufacturer: VIA Labs, Inc.
[ 84.607658] usb 2-1.5: SerialNumber: 0000000000000001
[ 87.791841] usb0: HOST MAC c6:90:fe:cd:dd:cc
[ 87.791854] usb0: MAC 4e:b7:b1:49:32:56
[ 87.793843] udc fe800000.usb: failed to start radxa-otgutils: -19
[ 178.074853] usb 2-1: USB disconnect, device number 2
[ 178.074869] usb 2-1.3: USB disconnect, device number 7
[ 178.081052] usb 2-1.5: USB disconnect, device number 8
[ 179.527631] usb 2-1: new high-speed USB device number 9 using ehci-platform
[ 179.676947] usb 2-1: New USB device found, idVendor=2109, idProduct=2817, bcdDevice= 7.00
[ 179.676962] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 179.676967] usb 2-1: Product: USB2.0 Hub
[ 179.676973] usb 2-1: Manufacturer: VIA Labs, Inc.
[ 180.394236] usb 2-1.2: new high-speed USB device number 10 using ehci-platform
[ 180.543455] usb 2-1.2: New USB device found, idVendor=2bc5, idProduct=0402, bcdDevice= 0.01
[ 180.543470] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 180.543476] usb 2-1.2: Product: ORBBEC Depth Sensor
[ 180.543481] usb 2-1.2: Manufacturer: Orbbec®
[ 180.694043] usb 2-1.3: new high-speed USB device number 11 using ehci-platform
[ 180.775439] usbcore: registered new interface driver snd-usb-audio
[ 180.841765] usb 2-1.3: New USB device found, idVendor=1a40, idProduct=0101, bcdDevice= 1.11
[ 180.841782] usb 2-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[ 180.841788] usb 2-1.3: Product: USB 2.0 Hub
[ 180.917346] usb 2-1.5: new high-speed USB device number 12 using ehci-platform
[ 181.016578] usb 2-1.5: New USB device found, idVendor=2109, idProduct=8817, bcdDevice= 0.01
[ 181.016591] usb 2-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 181.016597] usb 2-1.5: Product: USB Billboard Device
[ 181.016603] usb 2-1.5: Manufacturer: VIA Labs, Inc.
[ 181.016608] usb 2-1.5: SerialNumber: 0000000000000001