Re: dwc2: Raspberry Pi 3 B Plus stuck in lx_state DWC2_L2 since Linux 6.12-rc1

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

 



Hi,

since Minas didn't replied to any of my last mails, i hope some of the
other USB guys can help here.

Am 05.10.24 um 23:46 schrieb Stefan Wahren:
Am 03.10.24 um 13:21 schrieb Stefan Wahren:
Maybe this is a relevant side node: in the bad case the onboard
Ethernet chip LAN7800 is also not probed after startup (just root and
the hubs). It looks like a race between LAN7800 enumeration and
pm_runtime.


Okay, now it's clear that the missing enumeration of Microchip LAN7800
is related to power management, i enabled DEBUG for drivers/usb/core/hub.c

This results in the following kernel log (bad case, LAN7800 never
enumerated):

[    2.344302] dwc2 3f980000.usb: supply vusb_d not found, using dummy
regulator
[    2.351797] dwc2 3f980000.usb: supply vusb_a not found, using dummy
regulator
[    2.409961] dwc2 3f980000.usb: DWC OTG Controller
[    2.414821] dwc2 3f980000.usb: new USB bus registered, assigned bus
number 1
[    2.422040] dwc2 3f980000.usb: irq 51, io mem 0x3f980000
[    2.427698] usb usb1: udev 1, busnum 1, minor = 0
[    2.428501] hub 1-0:1.0: USB hub found
[    2.432384] hub 1-0:1.0: 1 port detected
[    2.436401] hub 1-0:1.0: standalone hub
[    2.436415] hub 1-0:1.0: ganged power switching
[    2.436427] hub 1-0:1.0: individual port over-current protection
[    2.436440] hub 1-0:1.0: Single TT
[    2.436453] hub 1-0:1.0: TT requires at most 8 FS bit times (666 ns)
[    2.436469] hub 1-0:1.0: power on to power good time: 2ms
[    2.436536] hub 1-0:1.0: local power source is good
[    2.436662] usb usb1-port1: DeviceRemovable is changed to 1 according
to platform information.
[    2.436681] hub 1-0:1.0: enabling power on all ports
[    2.443963] usb usb1-port1: status 0101 change 0001
[    2.723887] usb 1-1: new high-speed USB device number 2 using dwc2
[    2.920166] usb 1-1: udev 2, busnum 1, minor = 1
[    2.921003] hub 1-1:1.0: USB hub found
[    2.924983] hub 1-1:1.0: 4 ports detected
[    2.929105] hub 1-1:1.0: compound device; port removable status: FRRR
[    2.929120] hub 1-1:1.0: individual port power switching
[    2.929134] hub 1-1:1.0: individual port over-current protection
[    2.929302] hub 1-1:1.0: TT per port
[    2.929317] hub 1-1:1.0: TT requires at most 8 FS bit times (666 ns)
[    2.929334] hub 1-1:1.0: power on to power good time: 100ms
[    2.929487] hub 1-1:1.0: local power source is good
[    2.929922] hub 1-1:1.0: enabling power on all ports
[    2.930446] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[    2.930513] usb usb1-port1: enable change, status 00000503
[    3.031980] usb 1-1-port1: status 0101 change 0001
[    3.135941] hub 1-1:1.0: state 7 ports 4 chg 0002 evt 0000
[    3.136174] usb 1-1-port1: status 0101, change 0000, 12 Mb/s
[    3.207894] usb 1-1.1: new high-speed USB device number 3 using dwc2
[    3.228029] usb 1-1-port1: not reset yet, waiting 10ms
[    3.316285] usb 1-1.1: udev 3, busnum 1, minor = 2
[    3.317234] hub 1-1.1:1.0: USB hub found
[    3.321396] hub 1-1.1:1.0: 3 ports detected
[    3.325689] hub 1-1.1:1.0: compound device; port removable status: FRR
[    3.325706] hub 1-1.1:1.0: individual port power switching
[    3.325719] hub 1-1.1:1.0: individual port over-current protection
[    3.325983] hub 1-1.1:1.0: TT per port
[    3.325999] hub 1-1.1:1.0: TT requires at most 8 FS bit times (666 ns)
[    3.326017] hub 1-1.1:1.0: power on to power good time: 100ms
[    3.326268] hub 1-1.1:1.0: local power source is good
[    3.326577] hub 1-1.1:1.0: enabling power on all ports
[    3.430578] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0000
[    3.430627] hub 1-1.1:1.0: hub_suspend
[    3.431012] usb 1-1.1: usb auto-suspend, wakeup 1
[    3.443902] hub 1-1:1.0: hub_suspend
[    3.444117] usb 1-1: usb auto-suspend, wakeup 1
[    3.460127] hub 1-0:1.0: hub_suspend

After that i connect a USB mouse and rebooted (good case, LAN7800
enumerate as dev 5):

[    2.354524] dwc2 3f980000.usb: supply vusb_d not found, using dummy
regulator
[    2.361984] dwc2 3f980000.usb: supply vusb_a not found, using dummy
regulator
[    2.420112] dwc2 3f980000.usb: DWC OTG Controller
[    2.424969] dwc2 3f980000.usb: new USB bus registered, assigned bus
number 1
[    2.432193] dwc2 3f980000.usb: irq 51, io mem 0x3f980000
[    2.437851] usb usb1: udev 1, busnum 1, minor = 0
[    2.438669] hub 1-0:1.0: USB hub found
[    2.442553] hub 1-0:1.0: 1 port detected
[    2.446570] hub 1-0:1.0: standalone hub
[    2.446584] hub 1-0:1.0: ganged power switching
[    2.446597] hub 1-0:1.0: individual port over-current protection
[    2.446610] hub 1-0:1.0: Single TT
[    2.446623] hub 1-0:1.0: TT requires at most 8 FS bit times (666 ns)
[    2.446639] hub 1-0:1.0: power on to power good time: 2ms
[    2.446706] hub 1-0:1.0: local power source is good
[    2.446861] usb usb1-port1: DeviceRemovable is changed to 1 according
to platform information.
[    2.446880] hub 1-0:1.0: enabling power on all ports
[    2.453091] usb usb1-port1: status 0101 change 0001
[    2.557069] hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
[    2.557170] usb usb1-port1: status 0101, change 0000, 12 Mb/s
[    2.733021] usb 1-1: new high-speed USB device number 2 using dwc2
[    2.929282] usb 1-1: udev 2, busnum 1, minor = 1
[    2.930190] hub 1-1:1.0: USB hub found
[    2.934181] hub 1-1:1.0: 4 ports detected
[    2.938311] hub 1-1:1.0: compound device; port removable status: FRRR
[    2.938328] hub 1-1:1.0: individual port power switching
[    2.938341] hub 1-1:1.0: individual port over-current protection
[    2.938538] hub 1-1:1.0: TT per port
[    2.938554] hub 1-1:1.0: TT requires at most 8 FS bit times (666 ns)
[    2.938571] hub 1-1:1.0: power on to power good time: 100ms
[    2.938725] hub 1-1:1.0: local power source is good
[    2.939128] hub 1-1:1.0: enabling power on all ports
[    2.939621] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[    2.939709] usb usb1-port1: enable change, status 00000503
[    3.041138] usb 1-1-port1: status 0101 change 0001
[    3.041367] usb 1-1-port3: status 0301 change 0001
[    3.145072] hub 1-1:1.0: state 7 ports 4 chg 000a evt 0000
[    3.145310] usb 1-1-port1: status 0101, change 0000, 12 Mb/s
[    3.217022] usb 1-1.1: new high-speed USB device number 3 using dwc2
[    3.237176] usb 1-1-port1: not reset yet, waiting 10ms
[    3.325425] usb 1-1.1: udev 3, busnum 1, minor = 2
[    3.326447] hub 1-1.1:1.0: USB hub found
[    3.330665] hub 1-1.1:1.0: 3 ports detected
[    3.334953] hub 1-1.1:1.0: compound device; port removable status: FRR
[    3.334968] hub 1-1.1:1.0: individual port power switching
[    3.334982] hub 1-1.1:1.0: individual port over-current protection
[    3.335237] hub 1-1.1:1.0: TT per port
[    3.335253] hub 1-1.1:1.0: TT requires at most 8 FS bit times (666 ns)
[    3.335270] hub 1-1.1:1.0: power on to power good time: 100ms
[    3.335533] hub 1-1.1:1.0: local power source is good
[    3.335843] hub 1-1.1:1.0: enabling power on all ports
[    3.336658] usb 1-1-port3: status 0301, change 0000, 1.5 Mb/s
[    3.349213] usb 1-1-port3: not reset yet, waiting 10ms
[    3.421017] usb 1-1.3: new low-speed USB device number 4 using dwc2
[    3.437449] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0000
[    3.440409] hub 1-1.1:1.0: hub_suspend
[    3.440766] usb 1-1.1: usb auto-suspend, wakeup 1
[    3.521800] usb 1-1.3: udev 4, busnum 1, minor = 3
[    3.526564] input: PixArt Microsoft USB Optical Mouse as
/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:045E:00CB.0001/input/input0
[    3.540708] hid-generic 0003:045E:00CB.0001: input: USB HID v1.11
Mouse [PixArt Microsoft USB Optical Mouse] on usb-3f980000.usb-1.3/input0
[    3.913456] hub 1-1:1.0: state 7 ports 4 chg 0000 evt 0002
[    3.929063] usb 1-1.1: usb wakeup-resume
[    3.945030] usb 1-1.1: Waited 0ms for CONNECT
[    3.945066] usb 1-1.1: finish resume
[    3.945405] hub 1-1.1:1.0: hub_resume
[    3.945533] usb 1-1.1-port1: status 0101 change 0001
[    4.053058] usb 1-1-port1: resume, status 0
[    4.053114] hub 1-1.1:1.0: state 7 ports 3 chg 0002 evt 0000
[    4.053311] usb 1-1.1-port1: status 0101, change 0000, 12 Mb/s
[    4.129033] usb 1-1.1.1: new high-speed USB device number 5 using dwc2
[    4.149190] usb 1-1.1-port1: not reset yet, waiting 10ms
[    4.241681] usb 1-1.1.1: udev 5, busnum 1, minor = 4

Finally i applied the following hack and disconnect the mouse before
reboot (also good case, LAN7800 enumerate as dev 4)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 4b93c0bd1d4b..3111c0e60876 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5956,6 +5958,11 @@ static const struct usb_device_id hub_id_table[] = {
       .idProduct = USB_PRODUCT_USB5534B,
       .bInterfaceClass = USB_CLASS_HUB,
       .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
+    { .match_flags = USB_DEVICE_ID_MATCH_VENDOR
+                   | USB_DEVICE_ID_MATCH_PRODUCT,
+      .idVendor = USB_VENDOR_SMSC,
+      .idProduct = 0x2514,
+      .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND},
     { .match_flags = USB_DEVICE_ID_MATCH_VENDOR
                    | USB_DEVICE_ID_MATCH_PRODUCT,
       .idVendor = USB_VENDOR_CYPRESS,

[    2.350924] dwc2 3f980000.usb: supply vusb_d not found, using dummy
regulator
[    2.358389] dwc2 3f980000.usb: supply vusb_a not found, using dummy
regulator
[    2.416527] dwc2 3f980000.usb: DWC OTG Controller
[    2.421366] dwc2 3f980000.usb: new USB bus registered, assigned bus
number 1
[    2.428583] dwc2 3f980000.usb: irq 51, io mem 0x3f980000
[    2.434245] usb usb1: udev 1, busnum 1, minor = 0
[    2.435011] hub 1-0:1.0: USB hub found
[    2.438893] hub 1-0:1.0: 1 port detected
[    2.442911] hub 1-0:1.0: standalone hub
[    2.442925] hub 1-0:1.0: ganged power switching
[    2.442938] hub 1-0:1.0: individual port over-current protection
[    2.442950] hub 1-0:1.0: Single TT
[    2.442962] hub 1-0:1.0: TT requires at most 8 FS bit times (666 ns)
[    2.442979] hub 1-0:1.0: power on to power good time: 2ms
[    2.443047] hub 1-0:1.0: local power source is good
[    2.443175] usb usb1-port1: DeviceRemovable is changed to 1 according
to platform information.
[    2.443194] hub 1-0:1.0: enabling power on all ports
[    2.449893] usb usb1-port1: status 0101 change 0001
[    2.553873] hub 1-0:1.0: state 7 ports 1 chg 0002 evt 0000
[    2.553974] usb usb1-port1: status 0101, change 0000, 12 Mb/s
[    2.729813] usb 1-1: new high-speed USB device number 2 using dwc2
[    2.926128] usb 1-1: udev 2, busnum 1, minor = 1
[    2.927003] hub 1-1:1.0: USB hub found
[    2.930960] hub 1-1:1.0: 4 ports detected
[    2.935075] hub 1-1:1.0: compound device; port removable status: FRRR
[    2.935093] hub 1-1:1.0: individual port power switching
[    2.935106] hub 1-1:1.0: individual port over-current protection
[    2.935307] hub 1-1:1.0: TT per port
[    2.935324] hub 1-1:1.0: TT requires at most 8 FS bit times (666 ns)
[    2.935341] hub 1-1:1.0: power on to power good time: 100ms
[    2.935494] hub 1-1:1.0: local power source is good
[    2.935875] hub 1-1:1.0: enabling power on all ports
[    2.936328] hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002
[    2.936412] usb usb1-port1: enable change, status 00000503
[    3.037922] usb 1-1-port1: status 0101 change 0001
[    3.141878] hub 1-1:1.0: state 7 ports 4 chg 0002 evt 0000
[    3.142017] usb 1-1-port1: status 0101, change 0000, 12 Mb/s
[    3.213812] usb 1-1.1: new high-speed USB device number 3 using dwc2
[    3.233999] usb 1-1-port1: not reset yet, waiting 10ms
[    3.322291] usb 1-1.1: udev 3, busnum 1, minor = 2
[    3.323214] hub 1-1.1:1.0: USB hub found
[    3.327362] hub 1-1.1:1.0: 3 ports detected
[    3.331651] hub 1-1.1:1.0: compound device; port removable status: FRR
[    3.331668] hub 1-1.1:1.0: individual port power switching
[    3.331681] hub 1-1.1:1.0: individual port over-current protection
[    3.331947] hub 1-1.1:1.0: TT per port
[    3.331963] hub 1-1.1:1.0: TT requires at most 8 FS bit times (666 ns)
[    3.331980] hub 1-1.1:1.0: power on to power good time: 100ms
[    3.332230] hub 1-1.1:1.0: local power source is good
[    3.332529] hub 1-1.1:1.0: enabling power on all ports
[    3.434279] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0000
[    3.691359] hub 1-1.1:1.0: state 7 ports 3 chg 0000 evt 0002
[    3.691728] usb 1-1.1-port1: status 0101, change 0001, 12 Mb/s
[    3.818035] usb 1-1.1-port1: debounce total 100ms stable 100ms status
0x101
[    3.889848] usb 1-1.1.1: new high-speed USB device number 4 using dwc2
[    3.910007] usb 1-1.1-port1: not reset yet, waiting 10ms
[    4.002506] usb 1-1.1.1: udev 4, busnum 1, minor = 3

Does the last log provide some useful information about the root cause
why the hubs are usually suspended before Microchip LAN7800 could be
enumerated?

Best regards





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

  Powered by Linux