Hi Martin, On 7/11/2021 9:56 PM, Martin Blumenstingl wrote: > Hi Minas, > > thanks for taking the time to get back to us! > > On Sun, Jul 11, 2021 at 10:15 AM Minas Harutyunyan > <Minas.Harutyunyan@xxxxxxxxxxxx> wrote: >> >> Hi Martin, >> >> On 7/10/2021 9:07 PM, Martin Blumenstingl wrote: >>> Hi Minas, >>> >>> On Thu, Jul 1, 2021 at 1:09 AM Martin Blumenstingl >>> <martin.blumenstingl@xxxxxxxxxxxxxx> wrote: >>>> >>>> Hi Minas, >>>> >>> It's been a week since I sent my last mail >>> In case you are taking some days off: enjoy that time! >>> Please let us know if you have any questions about this as we're >>> looking forward to some hints on how to debug (and of course fix!) >>> this. >>> >> First of all sorry for late feedback. I missed this email thread because >> in the subject there are no "dwc2" and my Outlook not move it to "dwc2" >> folder of my mailbox based on rules. Today, because of rear count of >> emails in linux-usb I was able to catch it. >> I have added "dwc2" word in subject to avoid this situation later. > Understood - I'll try to keep that in mind for the future. > >> Couple of questions to understand the case. >> >> 1. Is it work normally earlier? If it was works fine earlier then which >> Kernel version and after which version broke? > I am not sure in which kernel version it broke. > Commit cc10ce0c51b13d ("usb: dwc2: disable power_down on Amlogic > devices") submitted by myself made USB hotplug work (at least that's > what the commit message says and that's what I remember). > I haven't done any git bisect though yet > >> 2. Do you saw in dmesg: >> dwc2_core_reset: HANG! Soft Reset timeout GRSTCTL_CSFTRST >> If yes, then PHY not initialized correctly. Core can't reset if some >> clocks from PHY are not available. > I think you saw this in Anand's kernel log output. > We came to the conclusion that some of his out-of-tree patches broke > USB for him. > >> 3. During our recent testings we met the issue with PHY driver. Artur >> found a bug in phy_generic driver and submitted patch on July 10: >> [PATCH v2] usb: phy: Fix page fault from usb_phy_uevent >> In your case, as I understand correctly, used >> drivers/phy/amlogic/phy-meson8b-usb2.c. Could you please check if same >> issue exist there. > phy-meson8b-usb2.c uses the generic PHY framework (from drivers/phy) > instead of the USB PHY framework (from drivers/usb/phy). > The generic PHY framework does not have any event support. > I am also not seeing any kernel BUG or WARN in dmesg. So my conclusion > is that the phy-meson8b-usb2.c driver is not affected by the same > issue. > >> 4. Can you provide full debug log for failed case? > sure, in my kernel config I now have: > CONFIG_USB_DWC2_DUAL_ROLE=y > CONFIG_USB_DWC2_DEBUG=y > # CONFIG_USB_DWC2_VERBOSE is not set > # CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set > CONFIG_USB_DWC2_DEBUG_PERIODIC=y > > With that, here's the output I get (including lsusb -t): > 1. booting my Odroid-C1 with no external USB device plugged in (the > USB hub you see in the lsusb output is soldered down on the PCB, so > it's "always there") > 2. plugging in a Corsair Voyager USB 3.0 flash drive (nothing > automatically happened), then running lsusb -vv and lsusb -t > 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. Thank, Minas > 4. reboot, keeping the USB 3.0 card reader plugged in during boot > > lsusb -vv is needed to make newly plugged in devices show up after boot. > This works fine with a few cheap USB 2.0 flash drives and an USB 3.0 > card reader that I have. > However, with a Corsair Voyager USB 3.0 flash drive this doesn't work, > I cannot see that on the bus at all. > > There's also a fifth case for which I have not attached any logs (but > I can do so if required): > If I have for example the USB 3.0 card reader or a cheap USB 2.0 flash > drive plugged in during boot then USB hotplug is working. > Even the Corsair Voyager USB 3.0 flash drive is detected. > > Please note that logfile 2 and 3 contain some "overlap" with the > previous log in the dmesg output. > For example: the first two lines in the "dmesg | tail -n13" output in > logfile 2 are from the first logfile. > I did this to show that I didn't omit anything by accident. > >> 5. I would preferred to see output of 'lsusb -t' for pass and fail cases. > I included that output in all attached logs > > If you need any additional info, logs, etc. then please don't hesitate to ask! > > > Best regards, > Martin >