Target Setup:
SoC: NXP i.MX8MP Port Configuration: 4x USB Ports total (2x USB 2.0, 2x USB 3.0)
OS : yocto scarthgap 6.6.52
Topology:
In our design the i.MX8MP SoC uses its internal USB2(USB1 lines are connected to otg in our design) controller in USB 3.0 mode to provide the upstream connection directly to an onboard Fresco Logic FL5500-2F0 hub. The hub then distributes this connection downstream to four physical ports: two ports are wired for full USB 3.0 operation, while the remaining two ports are wired only for USB 2.0 operation.
i.MX8MP (SoC Controller "USB2" lines, operating in USB 3.0 mode) -> USB 3.0 Hub (Fresco Logic FL5500-2F0, exposing 2x USB 3.0 and 2x USB 2.0 ports)
Issue Description: We are tracking down a fatal xHCI command ring lockup on the i.MX8MP,the hardware fails to respond to data commands issued by xchi drver on replug. The crash conditions are highly specific, isolating to a single hardware 3.0 usb port and the other 3.0 and 2.0 ports dont show this issue.
The lockup only occurs on one specific USB 3.0 port when a Low-Speed (LS) device is physically unplugged from a downstream High-Speed Hub, while there is at least one other Low speed device actively connected in the background in one of other 3 ports(if the background device low speed device is unplugged before trying re-plug on the problematic port the issue wont occur).
Key behavioral isolations:
Port Isolation: If we perform this exact same multi-device unplug test on the other USB 3.0 port, or on the USB 2.0 ports, it tears down cleanly. The crash is isolated to a single USB 3.0 port. Speed Isolation: The background device must be Low-Speed. It does not matter how many High-Speed devices (like USB storage drives) are connected in the background; if there is no other LS device present, the unplug handles cleanly.
note: One thing that mitigated this issue was un-authorising the bad usb port using the below command before trying physical un-plug and re-plug back in, echo 0 > /sys/bus/usb/devices/1-1.1/authorized
It also works if we unbind and bind the usb driver.
| Port Used | Background Device(s) on Hub | Device Being Unplugged | Disconnect Method | Host Controller Result |
| USB 3.0 (Good Port) | Low-Speed | Low-Speed | Physical Yank | Clean Teardown |
| USB 2.0 Ports | Low-Speed | Low-Speed | Physical Yank | Clean Teardown |
| USB 3.0 (Failing Port) | High-Speed(s) only | Low-Speed | Physical Yank | Clean Teardown |
| USB 3.0 (Failing Port) | None | Low-Speed | Physical Yank | Clean Teardown |
| USB 3.0 (Failing Port) | Low-Speed | Low-Speed | Software (authorised=0) | Clean Teardown |
| USB 3.0 (Failing Port) | Low-Speed | Low-Speed | Physical Yank | Cmd Ring Timeout (-110), Host Dies |
logs,
root@lec-imx8mp:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 1d5c:5510 Fresco Logic Frescologic USB2.0 HUB
Bus 001 Device 004: ID 413c:301a Dell Computer Corp. Dell MS116 Optical Mouse
Bus 001 Device 005: ID 413c:2113 Dell Computer Corp. KB216 Wired Keyboard
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 1d5c:5500 Fresco Logic Frescologic USB3.1Gen2 HUB
root@lec-imx8mp:~# [ 39.686850] usb 1-1.2: USB disconnect, device number 5
[ 41.191295] usb 1-1.1: new low-speed USB device number 6 using xhci-hcd
root@lec-imx8mp:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[ 51.427313] xhci-hcd xhci-hcd.1.auto: xHCI host not responding to stop endpoint command
[ 51.443403] xhci-hcd xhci-hcd.1.auto: xHCI host controller not responding, assume dead
[ 51.451350] xhci-hcd xhci-hcd.1.auto: HC died; cleaning up
[ 51.457035] usb 1-1-port1: couldn't allocate usb_device
[ 51.462339] usb 1-1: USB disconnect, device number 2
Bus 001 Device 002: ID 1d5c:5510 [ 51.467338] usb 1-1.4: USB disconnect, device number 4
Fresco Logic Frescologic USB2.0 H[ 51.475602] usb 2-1: USB disconnect, device number 2
Bus 001 Device 004: ID 413c:301a Dell Computer Corp. Dell MS116 Optical Mouse
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 002: ID 1d5c:5500 Fresco Logic Frescologic USB3.1Gen2 HUB
root@lec-imx8mp:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Any insight or fix on this issue would be hugely helpfull.
thanks