Re: ODROID-C1/-C2 USB Detection only triggered by some devices
From: Anand Moon <hidden>
Date: 2021-07-01 10:04:05
Also in:
linux-amlogic
Hi Martin & Alan & Matt, On Wed, 30 Jun 2021 at 06:05, Alan Stern [off-list ref] wrote:
On Tue, Jun 29, 2021 at 06:30:08PM +0200, Martin Blumenstingl wrote:quoted
Hi Alan, On Tue, Jun 29, 2021 at 6:18 PM Alan Stern [off-list ref] wrote: [...]quoted
quoted
quoted
usbcore.autosuspend=-1wow, 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 recognizedThat 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.Maybe because there's two related problems (I am guessing here): The first issue is that USB hotplug is not working at all on my Odroid-C1+ (which means: dwc2 + GL852G USB hub). The second issue is that the workaround we had before (running lsusb -vv to make "hot plugged" devices show up) is not working for some USB devices. It seems that using a different workaround (usbcore.autosuspend=-1) makes *all* USB devices show up - even without any "lsusb -vv" call. So I think we should focus on the first issue as it may also fix the other problem as well.Those two issues could well be related; they could both be a result of improper handling of USB bus suspend. Fixing that might fix both issues. Alan Sternquoted
[...]quoted
quoted
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).I'll wait for Minas thenquoted
quoted
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.indeed. I think it's good to know that it's not an issue affecting all Genesys Logic USB 2.0 hubs. As you mentioned above it's most likely that dwc2 is the culprit here. Or it might be some interoperability issue between dwc2 and GL852G Best regards, Martin
I have been trying some reorder code changes with PHY some new DTS changes both on C1+ and C2. with my changes I got false positve results. So in my debug investigation, it seems that USB reset is not working. I am attaching my latest code changes so that you could verify at your end. If we drop the phy_meson8b_usb2_reset(phy) all the USB PHY get initialized. Note: phy core does not call the .reset callback function on its own I have tried crazy ideas with reset API and new approaches, but it seems to fail and also used the reset-name features, but with no luck at my end. I wil try to followup on the suggestion shared in this email thread. I am attaching my usbmon output on Odroid C2. On some other note on USB HUB reset. I recollect following series (it like *mmc_pwrseq*) [0] https://lore.kernel.org/linux-devicetree/1474342607-27512-1-git-send-email-peter.chen@nxp.com/ (local) In oder to handle USB HUB reset on Amlogic SoC. [1] https://elixir.bootlin.com/linux/latest/source/arch/arm/boot/dts/meson8b-odroidc1.dts#L285 Thanks -Anand Below is the reset that failed on Odroicd C1+ with my latest changes. [ 1.264654] dwc2 c9040000.usb: mapped PA c9040000 to VA (ptrval) [ 1.264796] dwc2 c9040000.usb: Looking up vusb_d-supply from device tree [ 1.264811] dwc2 c9040000.usb: Looking up vusb_d-supply property in node /soc/usb@c9040000 failed [ 1.264842] dwc2 c9040000.usb: supply vusb_d not found, using dummy regulator [ 1.264970] dwc2 c9040000.usb: Looking up vusb_a-supply from device tree [ 1.264984] dwc2 c9040000.usb: Looking up vusb_a-supply property in node /soc/usb@c9040000 failed [ 1.265005] dwc2 c9040000.usb: supply vusb_a not found, using dummy regulator [ 1.265067] dwc2 c9040000.usb: registering common handler for irq35 [ 1.265122] dwc2 c9040000.usb: Looking up vbus-supply from device tree [ 1.265133] dwc2 c9040000.usb: Looking up vbus-supply property in node /soc/usb@c9040000 failed [ 1.266287] phy phy-c1108800.phy.0: Anand you are calling USB reset1 [ 1.266299] phy phy-c1108800.phy.0: Anand you are calling USB reset2 [ 1.266319] dwc2 c9040000.usb: Core Release: 3.10a (snpsid=4f54310a) [ 1.270234] dwc2 c9040000.usb: dwc2_core_reset: HANG! Soft Reset timeout GRSTCTL_CSFTRST [ 1.270561] dwc2: probe of c9040000.usb failed with error -16 [ 1.272469] dwc2 c90c0000.usb: mapped PA c90c0000 to VA (ptrval) [ 1.272597] dwc2 c90c0000.usb: Looking up vusb_d-supply from device tree [ 1.272611] dwc2 c90c0000.usb: Looking up vusb_d-supply property in node /soc/usb@c90c0000 failed [ 1.272639] dwc2 c90c0000.usb: supply vusb_d not found, using dummy regulator [ 1.272777] dwc2 c90c0000.usb: Looking up vusb_a-supply from device tree [ 1.272790] dwc2 c90c0000.usb: Looking up vusb_a-supply property in node /soc/usb@c90c0000 failed [ 1.272812] dwc2 c90c0000.usb: supply vusb_a not found, using dummy regulator [ 1.272869] dwc2 c90c0000.usb: registering common handler for irq36 [ 1.272920] dwc2 c90c0000.usb: Looking up vbus-supply from device tree [ 1.272932] dwc2 c90c0000.usb: Looking up vbus-supply property in node /soc/usb@c90c0000 failed [ 1.274094] phy phy-c1108820.phy.1: Anand you are calling USB reset1 [ 1.274105] phy phy-c1108820.phy.1: Anand you are calling USB reset2 [ 1.274124] dwc2 c90c0000.usb: Core Release: 3.10a (snpsid=4f54310a) [ 1.278078] dwc2 c90c0000.usb: dwc2_core_reset: HANG! Soft Reset timeout GRSTCTL_CSFTRST [ 1.278388] dwc2: probe of c90c0000.usb failed with error -16
Attachments
- mytesting_c1_reset.patch [application/octet-stream] 6066 bytes · preview
- c2.1u.mon.out [application/octet-stream] 1470 bytes
- c2.1t.mon.out [application/octet-stream] 1740 bytes
- c2.1s.mon.out [application/octet-stream] 37 bytes
- c2.0u.mon.out [application/octet-stream] 2058 bytes
- c2.0s.mon.out [application/octet-stream] 35 bytes