Xhci-mtk USB3 problem on mt7621

I have Asus RT-AC65P with MT7621 on board, it has USB3 slot. I use it with a USB3 flash stick. After several days on, USB3 stops working with messages like

Sun Nov 26 13:40:17 2023 kern.info kernel: [1510644.285189] usb 1-1: new high-speed USB device number 118 using xhci-mtk
Sun Nov 26 13:40:17 2023 kern.err kernel: [1510644.299554] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup context command completion code 0x11.
Sun Nov 26 13:40:26 2023 kern.info kernel: [1510653.285098] usb 1-1: new high-speed USB device number 121 using xhci-mtk
Sun Nov 26 13:40:26 2023 kern.err kernel: [1510653.299106] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup address command completion code 0x11.
Sun Nov 26 13:40:26 2023 kern.err kernel: [1510653.535149] xhci-mtk 1e1c0000.xhci: ERROR: unexpected setup address command completion code 0x11.

If I swap USB3 flash stick with USB2 one it works (with different driver, as I can see), but none of USB3 devices (which use xhci-mtk driver) do not work until a cold reboot (simple reboot command do not help).

Is there a hope for solving this problem?

UPD. And now even power cycle did not solve the problem. USB3 just didn't show in /dev nor in logread messages. Just like nothing is inserted. Although in another computer the stick is shown.

1 Like

A very common cause for erratic, unpredictable behavior on router USB ports is USB powering problems. Home routers rarely have reasonable head room on their power supply or a good powering concept for their USB rail at all.

You could try an active USB hub to verify this assumption.


Well, it is just a USB flash stick, it doesn't require much more than 500mA of power (just like USB 2, which still works!) It's not even USB SSD disc, although it doesn't require too much power also.

So, I'm almost sure this should not be a reason.

What do you mean by USB hub, and how it could help understand the powring problem?

a randomly selected USB hub with own power supply as example: https://www.amazon.com/-/-/dp/B0BDKFFRJZ
With this (which has its own PSU), the host (your router) is no longer responsible for powering the device. If the problem no longer appears with an active hub in the middle then it was a powering issue.

Sometimes its overall power draw, sometimes peak power draw stressing the host, USB host chips at some point then just shut down.

The typical issues here in the forum are:

  • it does not work at all, then installing drivers may fix it
  • it works, but erratic, then its maybe a powering issue.

It's true, I have this problem too.
A router using MT7621 - HC5962, with two USB ports. If the USB3 SSD hard drive is plugged into the USB3 port, it will not work. If you switch to the USB2 port, it will work. It is normal for this USB3 interface to be plugged into the USB2 TF-READER.

[root@OpenWrt:05:23 PM ~] # lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-mtk/2p, 480M
|__ Port 2: Dev 2, If 0, Class=, Driver=uas, 480M
[root@OpenWrt:05:23 PM ~] # opkg list-installed | grep usb
kmod-usb-core - 5.15.137-1
kmod-usb-ehci - 5.15.137-1
kmod-usb-ohci - 5.15.137-1
kmod-usb-storage - 5.15.137-1
kmod-usb-storage-extras - 5.15.137-1
kmod-usb-storage-uas - 5.15.137-1
kmod-usb-test - 5.15.137-1
kmod-usb-uhci - 5.15.137-1
kmod-usb-xhci-hcd - 5.15.137-1
kmod-usb-xhci-mtk - 5.15.137-1
kmod-usb2 - 5.15.137-1
kmod-usb2-pci - 5.15.137-1
kmod-usb3 - 5.15.137-1
libusb-1.0-0 - 1.0.26-3
libusb-compat4 - 0.1.7-2
luci-app-usb3disable - git-24.217.56735-8015371
usbutils - 014-1

But my device has only one USB port. So, to use it I have to find USB2 adapter (or hub). Until xhci-mtk would work reliably.

Be very careful selecting a powered USB hub:

Some will feed power back through the USB port on the router.

Thanks for the advice. But for now I'm stick to not self-powered adapter.

Judging from the test situation, this problem is related to USB power supply.

What make you think so? Here's power consumption from a decent FreeBSD system. USB3 stick consumes less than USB2 stick, but the former has troubles.

ugen0.2: <vendor 0x13fe USB DISK 3.0> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=ON (126mA)
ugen3.2: <JetFlash Mass Storage Device> at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (200mA)

There are LED indicators on the USB3 disk. If the host initiates a USB configuration command, the LED on the DISK will flash. After many tests, the LED did not flicker.

This webpage information shows that the xhci-mtk driver package has been supported for a very short time.

Then why USB2 works in the same port?

Maybe this question needs to be asked to the person who writes the code [Signed-off-by: Weijie Gao weijie.gao@mediatek.com]

1 Like