[Letux-kernel] USB sometimes not working

H. Nikolaus Schaller hns at goldelico.com
Wed Jun 9 13:27:47 CEST 2021


Hi,
thanks for the console logs! They at least give a first idea about the issue.

I have added Andreas and Tony to get more experience into the discussion.

The history of similar bug reports seem to be very old (ca. 13 years for BeagleBoard).

Googling did reveal that we (LetuxOS) had seen a similar issue on the jz4780 based CI20 board:

https://lists.goldelico.com/pipermail/letux-kernel/2020-September/005730.html

But the reason is likely completely different (because there is no ehci-omap
in an Ingenic SoC). But EHCI (USB2 interface) is a standard module used in
many chipsets.

> Am 09.06.2021 um 12:31 schrieb Michael Mrozek <EvilDragon at openpandora.org>:
> 
> Hi,
> 
> sometimes on our OS, the USB ports (as well as the modem) don't work.
> Not even a mouse or a similar low-power device works in that case.
> 
> The hardware should be fine, as IF it works after booting up, it works
> totally reliably.
> 
> I've attached a dmesg output from a user of the boot process when USB
> does NOT work.
> 
> I've also asked him to send a dmesg after he plugs in a device, so we
> can see what error USB produces.
> 
> But there are already a few interesting error messages in the dmesg.
> It seems the USB bus is found.. but produces an error.
> What's error -110 ?
> 
> Any idea how to debug this further?
> 
> AFAIR this effect changes based on the U-Boot / MLO setup you use. I
> remember that I tried various U-Boot / MLO combinations when starting
> the mass production - and one ALWAYS had a failing USB.

During my quick google searches I found some connection with U-Boot.
U-Boot usually also configures/resets the EHCI module so that a device
can boot from an USB disk.

E.g.: https://lists.denx.de/pipermail/u-boot/2013-December/168271.html

There is also very old (!) omap5 specific ehci u-boot discussion:

https://patchwork.ozlabs.org/project/uboot/patch/5193AFEC.60700@mm-sol.com/

But this may not be the code anyone of us is using. So it may be the wrong
direction to look for hints.

Anyways: yes there is likely a connection between U-Boot and kernel EHCI
(unless kernel driver does a full reset and fresh initialization and wipes
out any settings done by u-boot).

Therefore, it could also depend on whether the mouse is already connected
during U-Boot or plugged in afterwards.

> Didn't test that thoroughly, so take it with a grain of salt.
> But maybe some initialization parameters in the board file or similar
> are off?
> 
> 
> [7.084037] ehci-omap 4a064c00.ehci: EHCI Host Controller
> [7.100253] ehci-omap 4a064c00.ehci: new USB bus registered, assigned
> bus number 1
> [7.114047] ehci-omap 4a064c00.ehci: irq 106, io mem 0x4a064c00
> [7.154177] ehci-omap 4a064c00.ehci: USB 2.0 started, EHCI 1.00
> [7.170718] usb usb1: New USB device found, idVendor=1d6b,
> idProduct=0002, bcdDevice= 5.06
> [7.183576] usb usb1: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> [7.195528] usb usb1: Product: EHCI Host Controller
> [7.204562] usb usb1: Manufacturer: Linux 5.6.19-daveiii-pyradef-aufs
> ehci_hcd
> [7.216372] usb usb1: SerialNumber: 4a064c00.ehci
> [7.225588] hub 1-0:1.0: USB hub found
> [7.233218] hub 1-0:1.0: 3 ports detected
> [7.604098] usb 1-2: new high-speed USB device number 2 using ehci-omap
> [7.706183] ehci-omap 4a064c00.ehci: port 2 reset error -110

https://elixir.bootlin.com/linux/v5.6.19/source/drivers/usb/host/ehci-hub.c#L1086

Error -110 is ETIMEDOUT which could be that the EHCI module is no longer responding.
For whatever reasons.
 
Maybe the timout of 1000us is too short?

> [16.474154] usb usb1-port2: Cannot enable. Maybe the USB cable is bad?

https://elixir.bootlin.com/linux/v5.6.19/source/drivers/usb/core/hub.c#L2953

> [16.489352] usb usb1-port2: attempt power cycle

https://elixir.bootlin.com/linux/v5.6.19/source/drivers/usb/core/hub.c#L5243

BR,
Nikolaus



More information about the Letux-kernel mailing list