misaz
Posts: 2
Joined: Fri Aug 25, 2017 6:31 pm

Raspberry Pi 4 - USB stop working after connecting passive device

Fri Jun 05, 2020 8:25 pm

I am using Raspebrry Pi 4 for charging my small wireless earphones. It only consumes some current from USB and do not accept any USB communication (it does not accept address and do not provide any descriptor). At Raspberry Pi 3 there was never any problem with it but on Raspberry Pi 4 it randomly makes all USB ports (both USB 2.0 and 3.0) dead and floods dmesg with following error messages. "Random" means that I can connect it and usualy it works some time but after some minutes it stop works and became flood dmesg. Sometimes it flood immidiately. Sometimes it only floods dmesg with error messages but other ports are working normally. I have tried different cable without change but also notice that on Raspberry Pi 3 with same device and cable was no problem.

Code: Select all

[5824598.583269] usb 1-1-port4: attempt power cycle
[5824599.187012] usb 1-1.4: new low-speed USB device number 81 using xhci_hcd
[5824599.187581] usb 1-1.4: Device not responding to setup address.
[5824599.395572] usb 1-1.4: Device not responding to setup address.
[5824599.603024] usb 1-1.4: device not accepting address 81, error -71
[5824599.891027] usb 1-1.4: new low-speed USB device number 82 using xhci_hcd
[5824599.891594] usb 1-1.4: Device not responding to setup address.
[5824600.099647] usb 1-1.4: Device not responding to setup address.
[5824600.307052] usb 1-1.4: device not accepting address 82, error -71
[5824600.307358] usb 1-1-port4: unable to enumerate USB device
[5824600.863056] usb 1-1.4: new low-speed USB device number 83 using xhci_hcd
[5824600.943314] usb 1-1.4: device descriptor read/64, error -32
[5824601.131313] usb 1-1.4: device descriptor read/64, error -32
[5824601.527050] usb 1-1.4: new low-speed USB device number 84 using xhci_hcd
[5824601.607319] usb 1-1.4: device descriptor read/64, error -32
[5824601.795327] usb 1-1.4: device descriptor read/64, error -32
[5824601.903379] usb 1-1-port4: attempt power cycle
[5824602.507092] usb 1-1.4: new low-speed USB device number 85 using xhci_hcd
[5824602.507966] usb 1-1.4: Device not responding to setup address.
[5824602.716002] usb 1-1.4: Device not responding to setup address.
[5824602.923121] usb 1-1.4: device not accepting address 85, error -71
[5824603.003107] usb 1-1.4: new low-speed USB device number 86 using xhci_hcd
[5824603.004037] usb 1-1.4: Device not responding to setup address.
[5824603.211642] usb 1-1.4: Device not responding to setup address.
[5824603.419120] usb 1-1.4: device not accepting address 86, error -71
[5824603.419380] usb 1-1-port4: unable to enumerate USB device
[5824603.643127] usb 1-1.4: new low-speed USB device number 87 using xhci_hcd
[5824603.723379] usb 1-1.4: device descriptor read/64, error -32
[5824603.911390] usb 1-1.4: device descriptor read/64, error -32
[5824604.099121] usb 1-1.4: new low-speed USB device number 88 using xhci_hcd
[5824604.179394] usb 1-1.4: device descriptor read/64, error -32
[5824604.367392] usb 1-1.4: device descriptor read/64, error -32
[5824604.475452] usb 1-1-port4: attempt power cycle
[5824605.079172] usb 1-1.4: new low-speed USB device number 89 using xhci_hcd
[5824605.079742] usb 1-1.4: Device not responding to setup address.
[5824605.287713] usb 1-1.4: Device not responding to setup address.
[5824605.495171] usb 1-1.4: device not accepting address 89, error -71
[5824605.783189] usb 1-1.4: new low-speed USB device number 90 using xhci_hcd
[5824605.783761] usb 1-1.4: Device not responding to setup address.
[5824605.991752] usb 1-1.4: Device not responding to setup address.
[5824606.199192] usb 1-1.4: device not accepting address 90, error -71
[5824606.199443] usb 1-1-port4: unable to enumerate USB device
I have created script that "restart" usb and I run it over SSH when I want to make USBs working again. I do not need make full reboot of Raspberry Pi to make ports working again.

Code: Select all

#!/bin/bash

echo 0 > /sys/bus/usb/devices/1-1/authorized
echo 1 > /sys/bus/usb/devices/1-1/authorized
I ask if there is any better way to prvent USB stopping work and flooding dmesg with error messages when these pasive devices are connected to USB?

renice123
Posts: 198
Joined: Tue Oct 15, 2019 3:56 pm

Re: Raspberry Pi 4 - USB stop working after connecting passive device

Sat Jun 06, 2020 5:31 am

It seems to me that the best way to get rid of the problem is to take a usb cable without data wires. You can make such a cable yourself by physically disconnecting data + & data - Image

cakeslob
Posts: 3
Joined: Mon Dec 02, 2019 8:14 pm

Re: Raspberry Pi 4 - USB stop working after connecting passive device

Sat Jun 06, 2020 5:51 pm

When did this problem start for you? I have been running the exact same setup for 6 months, only usb is logitec wireless keyboard adapter . This same issue started happening to me this week. Sometimes on startup, but always after about 1 minute of runtime , all usb crash, keyboard stops working, and it no longer connects to usb devices. Once on startup it showed a wierd PCIE error ive never seen before. and same thing the only way to restore usb is restart

misaz
Posts: 2
Joined: Fri Aug 25, 2017 6:31 pm

Re: Raspberry Pi 4 - USB stop working after connecting passive device

Sat Jun 06, 2020 8:33 pm

In my case it occurs from start. Now I have uptime about 2 months (it was 67 days at the time I was posting dmesg in first post) and it occurs probably twice a week randomly. In fact I have no idea if the death of ports is caused by this pasive device or some PCIe fault or something else. Sometimes this device only floods dmesg with USB errors but other ports work correctly. I am trying to run over cable without data wires as recomended by @renice123. This looks like solution that can eliminate flooding dmesg and I will monitor if another error message (PCIe related or another one) will occur there.

Maybe the hint for searching cause may be knowledge what exactly my restart script does? It everytime helps me and I do not need full reboot for making USBs working again. What does writing zero 0 to authorized does? Does it restart VLI chip? Do it any communication with VLI chip? Do it any communication over PCIe? Is Linux or VLI chip responsible for USB device authorization feautre? Can I debug VLI chip state when it is unresponsive?

renice123
Posts: 198
Joined: Tue Oct 15, 2019 3:56 pm

Re: Raspberry Pi 4 - USB stop working after connecting passive device

Sun Jun 07, 2020 12:40 pm

I read somewhere (on the Russian-language Network) that usb power is "unusually" working in Linux.
Therefore, of course, it makes sense to work directly with usb, but I do not know if these commands are suitable for the ARM architecture.

For example, for a mouse (Intel architecture, Linux Buster) will give usb status output

grep . $(grep -rli mouse /sys/bus/usb/devices/usb*/ 2>/dev/null|grep product | rev | cut -f 2- -d '/' | rev )/power/{runtime_status,autosuspend,control,wakeup,autosuspend_delay_ms,runtime_usage}

/sys/bus/usb/devices/usb1/1-2/power/runtime_status:active
/sys/bus/usb/devices/usb1/1-2/power/autosuspend:-1
/sys/bus/usb/devices/usb1/1-2/power/control:auto
/sys/bus/usb/devices/usb1/1-2/power/wakeup:disabled
/sys/bus/usb/devices/usb1/1-2/power/autosuspend_delay_ms:-1000
/sys/bus/usb/devices/usb1/1-2/power/runtime_usage:1

You can continue to experiment and check or configure usb to turn the power to the device on or off.

You can see it all here
https://www.kernel.org/doc/Documentatio ... gement.txt

https://github.com/codazoda/hub-ctrl.c

Return to “Troubleshooting”