Xhci host not responding, host halt failed, -110

I am using openwrt version 19.07.5 r11257-5090152ae3
on an AVM FRITZ! Box 4040,

I have already activated (which works) a connection via usb tethering through a script that is run from /etc/hotplug.d/usb/99-my-device

the script of my choice executes some commands:

adb start-server; # starts the adb server to control the smartphone
adb shell svc data enable; #activate mobile data on your smartphone
adb shell svc usb setFunctions rndis; #activate usb tethering on your smartphone
ifup usb; #activate the usb interface

if I program a hardware button that does:

ifdown usb; #disable the usb interface
adb kill-server; #kills the adb server

I don't get any errors and if I disconnect the USB cable and then reconnect the cable, the whole process is correctly re-executed

if I don't press the hardware button and I unplug the usb cable directly
i get an error:

usb 1-1: USB disconnect, device number 5
xhci-hcd xhci-hcd.0.auto: xHCI host not responding to stop endpoint command.
xhci-hcd xhci-hcd.0.auto: Host halt failed, -110
xhci-hcd xhci-hcd.0.auto: xHCI host controller not responding, assumes dead
xhci-hcd xhci-hcd.0.auto: HC died; cleaning up

and at the following connection of the usb cable I no longer detect new additions via lsusb even by inserting a usbkey it is as if the usb port is dead (just a reboot, it brings me back to an acceptable condition)

i tried to run via /etc/hotplug.d/usb/99-my-device
of the actions in phase of "unbind" of the interface but these actions
rightly they are also performed when inserting the new usb device as the process of modification through the commands
adb changes the "ID" of the usb device.

some additional information:
kmod-usb-core - 4.14.209-1
kmod-usb-net - 4.14.209-1
kmod-usb-net-cdc-ether - 4.14.209-1
kmod-usb-net-cdc-mbim - 4.14.209-1
kmod-usb-net-cdc-ncm - 4.14.209-1
kmod-usb-net-rndis - 4.14.209-1
kmod-usb-storage - 4.14.209-1
kmod-usb-wdm - 4.14.209-1
kmod-usb3 - 4.14.209-1
libusb-1.0-0 - 1.0.22-2
usbutils - 007-10

dmesg when activating the script:

usb 1-1: new high-speed USB device number 3 using xhci-hcd
rndis_host 1-1: 1.0 usb0: register 'rndis_host' at usb-xhci-hcd.0.auto-1, RNDIS device

dmesg on activation via script programmed with hardware button:

usb 1-1: USB disconnect, device number 3
rndis_host 1-1: 1.0 usb0: unregister 'rndis_host' usb-xhci-hcd.0.auto-1, RNDIS device

if you want more information just ask, thanks to anyone who wants to give me a hand or just read the post

You're quite welcome. I read the post (very long to describe something quite clear)...but I'm not sure what you need a "hand" with though, as you never actually state. Are you simply stating a fact (I assume not...can you state a question for clarity)?

I would like to disconnect the smartphone directly by removing the cable without the usb port dead,
and that when the cable is reconnected it is performed again
script (with the script programmed through a hardware button everything is correct) removing the cable no (I don't know what I have to do to solve the problem, I know that it is a problem generated by my action, I would like to know if there are options to add to the module loading or anything else I can do to avoid the reboot of the entire system).

thanks anyway for your interest

:confused:

You want a failure not to occur when you physically cause a failure???

(I was kinda hoping you didn't want that...)

Have you tried modprobe?

This statement totally confused me...because your posts seemed as if you configured it yourself.

1 Like

I assume that there is a way as the hotplug should take into account such events, I did not understand why the usb port is
be inaccessible after this event while the other usb port
with a USB key inserted it is active and functioning.

as I said I tried to execute commands through the hotplug
in phase of "unbind" or "remove" but rightly the same commands
they are also performed during the insertion phase as the 'IDs' of the
device change according to the adb command executed.

also commands that involved removing modules:
rmmod cdc_mbim
rmmod rndis_host
rmmod cdc_ncm
rmmod cdc_ether
rmmod xhci_plat_hcd
rmmod xhci_pci
rmmod xhci_hcd
and then their reintegration
modprobe ... (etc)
but even these are done when they shouldn't

there is a way to reset the usb ports without rebooting
of the whole router?

thanks for your interest

echo 'on' > '/sys/bus/usb/devices/usb2/power/control'

i solved it with a crontab which is run based on the existence of a file created by my script which runs all the appropriate rmmods and then all the appropriate modprobes

thanks

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.