ODROID-C1/-C2 USB Detection only triggered by some devices
Alan Stern
stern at rowland.harvard.edu
Tue Jun 29 09:18:07 PDT 2021
I think we should CC: the maintainer of the dwc2 driver (added).
On Tue, Jun 29, 2021 at 05:51:51PM +0200, Martin Blumenstingl wrote:
> Hi Alan,
>
> Your help here is very much appreciated!
>
> On Tue, Jun 29, 2021 at 5:05 PM Alan Stern <stern at rowland.harvard.edu> wrote:
> [...]
> > > The attached mon1.txt is the output I get
> >
> > Did you remove something from the beginning of this trace? It starts
> > with what appears to be the tail end of a resume sequence for the
> > on-board Genesys Logic hub. If you didn't remove anything then
> > something is pretty wrong because the hub was apparently only
> > partially suspended.
> I have not removed anything from the output (at least not on purpose).
> To verify I just re-tried and got a similar result
Yeah, okay. This indicates that the dwc2 driver has got a problem with
suspending ports. Perhaps not surprising, given the context...
> > Anyway, the trace says that when the lsusb command ran, the hub woke up
> > and didn't see any connections on any of its ports. This could be
> > caused by a bug in the hub itself, a bug in the way the system handles
> > the hub, or maybe a bug in the way it handles a PHY or other component
> > external to the hub.
> This reminds me of commit cc10ce0c51b13d ("usb: dwc2: disable
> power_down on Amlogic devices") [0]
> I checked and the code for this commit is still in mainline (so it was
> not reverted - either on purpose or by accident).
This isn't exactly about powering down; this is about putting the port
into suspend. If the dwc2 driver is really suspending the port, it's
not telling the USB core drivers. But that commit may be related.
It's possible that the Genesys Logic hub doesn't like to have remote
wakeup enabled without going into suspend.
> [...]
> > > In case it's relevant for your further analysis:
> > > - Odroid-C1+ and Odroid-C2 both use the USB PHY driver from
> > > drivers/phy/amlogic/phy-meson8b-usb2.c
> > > - Odroid-C1+ and Odroid-C2 both use use the dwc2 driver (running in
> > > host-only mode in this scenario. there's a second OTG capable dwc2
> > > controller which is currently disabled in mainline Linux on both
> > > devices)
> > > - Odroid-C1+ and Odroid-C2 have a soldered down 4-port Genesys Logic USB hub
> > > - Odroid-C1+ does not use any GPIO to control VBUS on usb1
> >
> > Since the problem may be related to runtime power management, you
> > should try booting with the command line parameter
> >
> > usbcore.autosuspend=-1
> wow, this helps indeed
> my steps are:
> - power off my Odroid-C1+
> - unplug all USB devices
> - boot with usbcore.autosuspend=-1 in the kernel cmdline
> - plugin my Corsair Voyager USB 3.0 flash drive (which was only
> detected before if an additional USB 2.0 flash drive was plugged in
> during boot)
> -> without any lsusb magic the device was immediately recognized
That does show pretty convincingly that runtime suspend is causing the
problem. But I still have no idea why the problem affects some devices
and not others. It's a mystery.
> > to disable default USB runtime suspends. Also, check the contents of
> > /sys/bus/usb/devices/1-2/power/autosuspend to make sure that runtime
> > suspend really is disabled. Does that make the problem go away?
> with usbcore.autosuspend=-1 (after plugging in my Corsair Voyager):
> # grep "" /sys/bus/usb/devices/*/power/autosuspend
> /sys/bus/usb/devices/1-1.1/power/autosuspend:-1
> /sys/bus/usb/devices/1-1/power/autosuspend:-1
> /sys/bus/usb/devices/usb1/power/autosuspend:-1
>
> after rebooting without usbcore.autosuspend=-1 (and no USB device
> plugged in during boot):
> # grep "" /sys/bus/usb/devices/*/power/autosuspend
> /sys/bus/usb/devices/1-1/power/autosuspend:0
> /sys/bus/usb/devices/usb1/power/autosuspend:0
>
> I think the next step is narrowing down which component is causing this issue.
Maybe Minas can help. He knows a lot more about dwc2 than I do (which
is practically nothing).
> Interestingly my PC (running 5.12.13-arch1-2) also has two Genesys
> Logic USB hubs with the same USB vendor and device IDs as my
> Odroid-C1+: 05e3:0610.
> These hubs are connected to my AMD Ryzen 5000 CPU or the B550 chipset:
> usb1 1d6b:0002 09 1IF [USB 2.00, 480 Mbps, 0mA]
> (xhci-hcd 0000:02:00.0) hub
> 1-3 05e3:0610 09 1IF [USB 2.10, 480 Mbps, 100mA]
> (GenesysLogic USB2.0 Hub) hub
> [...]
> 1-7 05e3:0610 09 1IF [USB 2.00, 480 Mbps, 100mA]
> (Genesys Logic, Inc. Hub) hub
>
> So far I have not observed any problems on my PC.
Presumably because it uses xHCI rather than dwc2.
Alan Stern
> This is the lsusb.py output on my Odroid-C1+:
> usb1 1d6b:0002 09 1IF [USB 2.00, 480 Mbps, 0mA]
> (Linux 5.13.0-02058-g8452e2c291aa-dirty dwc2_hsotg DWC OTG Controller
> c90c0000.usb) hub
> 1-1 05e3:0610 09 1IF [USB 2.00, 480 Mbps, 100mA]
> (Genesys Logic, Inc. Hub) hub
>
>
> Best regards,
> Martin
>
>
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/dwc2/params.c?id=cc10ce0c51b13d1566d0ec1dcb472fb86330b391
More information about the linux-amlogic
mailing list