OSD3358 USB enumeration problem

Hi,
I have got a usb device connected via usb hub (LAN9514) to the OSD3358 processor (Debian 4.14.93-bone17.1)

After few restarts of my USB device connected to the OSD3358 I receive error:

[ 6992.492407] usb 1-1-port3: unable to enumerate USB device

After that the only way to make it working is to:

rmmod musb_dsps
modprobe musb_dsps

What could cause this situation? Is there any patch or any way to avoid reloading whole usb bus?

I tried with no effect:

echo “on” > /sys/bus/usb/devices/usb1/power/level
echo “on” > /sys/bus/usb/devices/1-1/power/level
echo “on” > /sys/devices/platform/ocp/47400000.usb/power/control

Logs below:

`
[ 6906.798584] usb 1-1.3: new full-speed USB device number 64 using musb-hdrc
[ 6906.805609] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc6f0f40
[ 6911.888920] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6911.900935] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c2ca4980
[ 6917.007006] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6917.013114] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51fa40
[ 6922.125261] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6922.131568] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51fa40
[ 6922.138717] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.144089] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.173165] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f800
[ 6922.180314] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.185680] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.191019] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6922.198129] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.210129] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f800
[ 6922.217300] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.222666] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6922.289084] usb 1-1.3: device descriptor read/64, error -110
[ 6922.401091] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51fc00
[ 6927.499639] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6927.505659] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51fc00
[ 6932.618030] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6932.630191] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc48de40
[ 6937.736437] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6937.748477] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c491a2c0
[ 6937.755648] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.761015] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.808395] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c491a2c0
[ 6937.815565] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.820934] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.826276] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6937.833378] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.876351] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf db08e180
[ 6937.883523] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.888899] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6937.980345] usb 1-1.3: device descriptor read/64, error -110
[ 6938.100430] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0a80
[ 6938.107597] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.112970] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.144446] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0480
[ 6938.151625] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.156996] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.204395] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0d40
[ 6938.211564] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.216929] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.222272] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6938.229373] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.270941] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0d40
[ 6938.278139] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.283510] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6938.376299] usb 1-1.3: new full-speed USB device number 65 using musb-hdrc
[ 6938.383317] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0180
[ 6943.622668] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6943.628607] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0180
[ 6948.741245] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6948.747221] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf db059080
[ 6953.859915] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6953.871941] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d7b431c0
[ 6953.879111] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6953.884485] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6953.931900] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d7b431c0
[ 6953.939067] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6953.944434] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6953.949773] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6953.956874] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6953.999878] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d7b431c0
[ 6954.007045] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6954.012431] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6954.099892] usb 1-1.3: device descriptor read/64, error -110
[ 6954.215907] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d7b43f00
[ 6959.234788] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6959.246656] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dada6640
[ 6964.353103] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6964.359246] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d7a83340
[ 6969.471823] usb 1-1.3: kworker/0:3 timed out on ep0in len=0/64
[ 6969.478087] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c5311880
[ 6969.485244] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.490613] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.519818] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c5311400
[ 6969.526969] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.532335] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.537676] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6969.544781] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.557936] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c5311400
[ 6969.565123] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.570488] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.639933] usb 1-1.3: device descriptor read/64, error -110
[ 6969.751754] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc430ac0
[ 6969.758902] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.764267] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.775054] usb 1-1-port3: attempt power cycle
[ 6969.780896] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dab967c0
[ 6969.788056] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6969.793441] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.007701] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51fe00
[ 6970.014865] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.020250] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.135704] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f640
[ 6970.142864] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.148231] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.179664] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f580
[ 6970.186821] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.192187] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.197528] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6970.204636] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.217325] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f580
[ 6970.224510] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.229883] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.239454] hub 1-1:1.0: port_wait_reset: err = -11
[ 6970.244559] usb 1-1-port3: not enabled, trying reset again…
[ 6970.253142] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f400
[ 6970.260314] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.265755] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.483589] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f5c0
[ 6970.490738] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.496112] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.501452] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6970.508554] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.521414] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51f5c0
[ 6970.528601] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.533986] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6970.603518] usb 1-1.3: new full-speed USB device number 66 using musb-hdrc
[ 6970.610574] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf dc51fc40
[ 6975.870949] usb 1-1.3: kworker/0:3 timed out on ep0out len=0/0
[ 6976.090438] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf c491a680
[ 6981.245205] usb 1-1.3: kworker/0:3 timed out on ep0out len=0/0
[ 6981.468936] usb 1-1.3: device not accepting address 66, error -110
[ 6981.475538] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0800
[ 6981.482692] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.488064] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.513441] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0a40
[ 6981.520620] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.525996] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.552960] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0c80
[ 6981.560109] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.565475] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.570815] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6981.577916] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.591275] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0c80
[ 6981.598466] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.603834] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6981.672884] usb 1-1.3: new full-speed USB device number 67 using musb-hdrc
[ 6981.679914] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf d78d0900
[ 6986.875745] usb 1-1.3: kworker/0:3 timed out on ep0out len=0/0
[ 6987.087683] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf db0598c0
[ 6992.250558] usb 1-1.3: kworker/0:3 timed out on ep0out len=0/0
[ 6992.462458] usb 1-1.3: device not accepting address 67, error -110
[ 6992.468780] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf db059a80
[ 6992.475916] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6992.481283] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6992.492407] usb 1-1-port3: unable to enumerate USB device
[ 6992.498131] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf db059a80
[ 6992.505271] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6992.510640] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6992.521705] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0008
[ 6992.527445] musb-hdrc musb-hdrc.1: TX ep0 fifo e0f3ac20 count 8 buf db059980
[ 6992.534582] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6992.539947] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)
[ 6992.545287] musb-hdrc musb-hdrc.1: RX ep0 fifo e0f3ac20 count 4 buf dab6e280
[ 6992.552404] musb-hdrc musb-hdrc.1: usbintr (0) epintr(1)

`

It looks like the dsps_interrupt (musb_dsps.c) is not called when device enters this state.

In the normal condition, we start the transfer, and straight away interrupt is called:

Start TX0 pio 80:06:00:01:00:00:40:00 TXCSR: 00a7 ep0in(18): 12:01:00:02:00:00:00:40:15:19:0a:c0:00:01:01:02:03:01

when this error happens kernel retries after 5s:

[ +0.103672] usb 1-1.3: new full-speed USB device number 75 using musb-hdrc [ +0.032106] Start TX0 pio 80:06:00:01:00:00:40:00 TXCSR: 00a7 [ +5.079939] Start TX0 pio 80:06:00:01:00:00:40:00 TXCSR: 00af

I noticed that we can restart the driver and recover from this state with these commands:

`
echo 0 > /sys/kernel/debug/musb-hdrc.1/softconnect
echo 1 > /sys/kernel/debug/musb-hdrc.1/softconnect

`

W dniu środa, 10 czerwca 2020 15:11:08 UTC+2 użytkownik kami...@jrdltd.co.uk napisał:

We use Keysight oscilloscope to decode frames and trigger on “80:06:00:01” sequence. Normal restart procedure seems fine, the oscilloscope triggers the data sequence, however when the system enters fault condition we no longer see oscilloscope triggering.

We tried to log traffic with usbmon, in the fault condition “GET DESCRIPTOR” request fails with this status:
URB status: No such file or directory (-ENOENT) (-2)

The problem doesn’t appear when we set the maximum speed to ‘full-speed’ in the device tree. This isn’t the solution for us due to a high-speed device connected to the same bus.

&usb1 { status = "okay"; dr_mode = "host"; maximum-speed = "full-speed"; };

W dniu poniedziałek, 22 czerwca 2020 15:22:38 UTC+2 użytkownik krzy...@jrdltd.co.uk napisał:

Has a different brand of USB hub been tried? I could see some hubs
locking the entire bus to the speed of the slowest connected device.
{Not quite definitive: https://en.wikipedia.org/wiki/USB
"""
The throughput of each USB port is determined by the slower speed of either
the USB port or the USB device connected to the port.
"""
}

{My apologies, but I'm unable to track just who is or is not using hubs in
that infernal top-posted response chain... I don't read messages from
bottom up.}

The problem doesn’t appear when we set the maximum speed to ‘full-speed’ in
the device tree. This isn’t the solution for us due to a high-speed device
connected to the same bus.

&usb1 {
status = “okay”;
dr_mode = “host”;
maximum-speed = “full-speed”;
};

Has a different brand of USB hub been tried? I could see some hubs
locking the entire bus to the speed of the slowest connected device.
{Not quite definitive: https://en.wikipedia.org/wiki/USB
“”"
The throughput of each USB port is determined by the slower speed of either
the USB port or the USB device connected to the port.
“”"
}

{My apologies, but I’m unable to track just who is or is not using hubs in
that infernal top-posted response chain… I don’t read messages from
bottom up.}

We are certain that the LAN9514 operates on high-speed where it can and on full-speed on ports where a full-speed device is connected. We can decode only full-speed frames with Keysight, we don’t have a tool to sample and decode high-speed traffic. We tested only LAN9514, this is what we have on our custom PCB.

Based on the usbmon we can tell that ‘descriptor request’ is sent, based on the Keysight oscilloscope we know that this request doesn’t reach the full-speed device. Is there any way to reset single USB hub port from Linux? We know that the problem is recovered when the musb_dsps module is reloaded.

Please find usbmon captures attached.

usblog-failure.pcap (4.59 KB)

usblog-success.pcap (6.81 KB)