Re: ODROID-C1/-C2 USB Detection only triggered by some devices dwc2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Minas,

On Wed, Jul 14, 2021 at 5:27 PM Minas Harutyunyan
<Minas.Harutyunyan@xxxxxxxxxxxx> wrote:
>
> Hi Martin,
>
> On 7/12/2021 3:35 PM, Martin Blumenstingl wrote:
> > Hi Minas,
> >
> > On Mon, Jul 12, 2021 at 8:42 AM Minas Harutyunyan
> > <Minas.Harutyunyan@xxxxxxxxxxxx> wrote:
> > [...]
> >>> 3. unplugging the Corsair Voyager and plugging in a USB 3.0 card
> >>> reader (nothing automatically happened), then running lsusb -vv and
> >>> lsusb -t
> >> Could you please set verbose debugging:
> >> CONFIG_USB_DWC2_VERBOSE=y
> >>
> >> and repeat test 3. There are couple of transaction errors and some EP
> >> stalled. I want to understand on which device/ep this happen.
> > sure, I attached the dmesg output (gzipped, since it's uncompressed
> > size is 1.5M) with CONFIG_USB_DWC2_VERBOSE=y
> > The lsusb -vv and lsusb -t outputs are the same so I did not attach them again.
> >
> >
> > Best regards,
> > Martin
> >
>
> Per our understanding this issue is because of power budget and
> autosuspend functionality.
Many thanks for doing this investigation!

> Autosuspend. Please review this patch: "usb: core: hub: Disable
> autosuspend for Cypress CY7C65632"
>
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/commit/?h=usb-next&id=a7d8d1c7a7f73e780aa9ae74926ae5985b2f895f
>
> It's very similar to your case. Actually you already tested
> usbcore.autosuspend=-1 and it's helped you.
> Could you please develop same patch for your soldered hub and test it.
I found that drivers/usb/core/hub.c already has an entry for Genesys
Logic USB hubs.
It uses HUB_QUIRK_CHECK_PORT_AUTOSUSPEND instead of
HUB_QUIRK_DISABLE_AUTOSUSPEND though.
So I wrote a patch to change that (I attached it to this mail for
reference, I will submit it as a proper patch one I understand enough
about this).

With this patch applied all USB devices I have are auto-detected when
hot-plugged.

My doubt with this is that my desktop PC (using an ASUS B550-F
motherboard) comes with a few of these USB hubs soldered down as well
- and there the behavior is different.
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/10p, 480M
   ID 1d6b:0002 Linux Foundation 2.0 root hub
   /sys/bus/usb/devices/usb1  /dev/bus/usb/001/001
   |__ Port 3: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
       ID 05e3:0610 Genesys Logic, Inc. Hub
       /sys/bus/usb/devices/1-3  /dev/bus/usb/001/002
[...]
   |__ Port 7: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
       ID 05e3:0610 Genesys Logic, Inc. Hub
       /sys/bus/usb/devices/1-7  /dev/bus/usb/001/005

I plugged in the Corsair Voyager USB 3.0 drive which is not being
detected on my Odroid-C1+ and instantly this shows up in my kernel
log:
  usb 1-7.3: new high-speed USB device number 46 using xhci_hcd
  usb 1-7.3: New USB device found, idVendor=1b1c, idProduct=1a03,
bcdDevice= a.00
  usb 1-7.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-7.3: Product: Voyager 3.0
  usb 1-7.3: Manufacturer: Corsair

So I am wondering why it works there but not on my Odroid-C1, with the
(only known) difference being the host controller (xhci_hcd vs dwc2)
which is being used.

> Power budget. Old, cheap flash disks required about 200-300ma, but most
> of USB3 devices require 500ma. It could be serious issue to explore this
> devices with USB2 hubs. Even if this type of devices will successfully
> enumerated on EP0 without power problems, after set_interface when
> enabling multiple EP's (i.e. BULK IN and OUT for mass storage) power
> requirements should be increased which can violate USB2 hub port rules.
With your hint from above (thanks again!) I found commit
1208f9e1d758c9 ("USB: hub: Fix the broken detection of USB3 device in
SMSC hub").
The message of that commit says: [...] Board is [...] not able to
detect the USB3.0 mass storage devices
Using HUB_QUIRK_DISABLE_AUTOSUSPEND makes all of my USB 3.0 devices
show up as well during hot-plug (no lsusb trickery needed).
So while there may be some power budget issue, I think the main
problem for me is the hub suspend.


Best regards,
Martin
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index d1efc7141333..ac39d15af6ba 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5730,7 +5730,7 @@ static const struct usb_device_id hub_id_table[] = {
 			| USB_DEVICE_ID_MATCH_INT_CLASS,
       .idVendor = USB_VENDOR_GENESYS_LOGIC,
       .bInterfaceClass = USB_CLASS_HUB,
-      .driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND},
+      .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
     { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS,
       .bDeviceClass = USB_CLASS_HUB},
     { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS,

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux