Repository navigation
usb: dwc3: apple: do not enable USB2 hardware LPM - #442
riopierrefrancois wants to merge 1 commit into
Conversation
On the Type-C controllers driven by dwc3-apple the USB2 port does not come back from L1. A BESL-capable high-speed device on a root port enumerates, the bus idles for 20 to 35 ms, and the next transfer raises a port error (PEC) and completes with a transaction error. Every later transfer fails the same way and a port reset does not recover the device: uvcvideo 4-1:1.0: Failed to query (GET_INFO) UVC control 2 on unit 3: -71 (exp. 1). uvcvideo 4-1:1.1: Failed to initialize the device (-71). Devices behind a hub are unaffected, because xHCI only enables USB2 hardware LPM for non-hub devices on a root port. Set usb2_lpm_disable on the dwc3 core so xHCI gets XHCI_HW_LPM_DISABLE. Tested on a Mac Studio M1 Max (j375c, t6001) with a Logitech Brio 500 (046d:0943) on the rear ports. Other SoCs are not tested. Link: omacom#380 Generated-by: LLM Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: riopierrefrancois <rio.pierrefrancois@gmail.com>
joshuaswarren
left a comment
There was a problem hiding this comment.
Tested on 16-inch M1 Max MacBook Pro (T6001), Omarchy, Studio Display over Thunderbolt.
The Studio Display camera (USB device 3-1.4, high-speed) does not expose USB2 LPM controls in sysfs. No devices on this system have power/usb2_hardware_lpm or power/usb2_lpm_besl files. Only USB3 LPM controls exist (usb3_hardware_lpm_u1/u2 on the USB4 controller).
Streamed the camera for 2+ minutes with the port idle between streams. No PEC or transaction errors in dmesg.
Without sysfs controls for USB2 LPM, I cannot verify whether the dwc3-apple usb2_lpm_disable = true flag changes behavior. The bug cannot be reproduced on this hardware.
The fix is correct in principle (disabling USB2 hardware LPM to prevent port errors), but I cannot confirm it resolves a real issue here.
|
[Joshua's agent] Boot test of 68bb2ca on a 16-inch M1 Max MacBook Pro (T6001), kernel 7.3.0-2 (integration/aurora plus the lab config), one change versus the same kernel without it: dwc3-apple.ko with this patch. What I can confirm:
What I could not test: the failing case. On this machine a Studio Display is attached through a PCIe xHCI behind the Thunderbolt tunnel, not behind dwc3, and the only device on the dwc3 hosts is a 10G Ethernet adapter on the USB3 side. There is no high-speed device on a dwc3 root port, so a camera stream followed by idle cannot reproduce the PEC error or show the fix. The test needs a BESL-capable USB2 camera plugged straight into a Type-C port. I have none attached right now. So this is a boot check of the patch, not a reproduction of the fix. |
On the Type-C controllers driven by
dwc3-apple, the USB2 port does not come back from L1. A BESL-capable high-speed device plugged straight into a root port enumerates, the bus idles for 20 to 35 ms, and the next transfer raises a portPECevent and completes withUSB Transaction Error. Every later transfer fails the same way and a port reset does not recover the device.Seen with a Logitech Brio 500 (
046d:0943) on every rear port of a Mac Studio M1 Max (apple,j375c, t6001):Full-speed devices and anything behind a hub are unaffected, because xHCI only enables USB2 hardware LPM for non-hub devices on a root port.
This sets
usb2_lpm_disableon the dwc3 core, which becomesXHCI_HW_LPM_DISABLE.Tested: j375c (t6001), a local build of 7.2.11 (4fdd0fc) with this change and the packaged config, m1n1 with omacom/m1n1#46. With the patch and no usbcore quirk, the camera's video, audio and HID interfaces bind, with no
-71in three boots. Without the patch,usbcore.quirks=046d:0943:k(USB_QUIRK_NO_LPM) set before plugging in gives the same result, which is what points at LPM.power/usb2_hardware_lpmstill readsenabledafterwards; it reports what is allowed, not what xHCI did.Not tested: any other SoC, other high-speed devices, suspend. The change applies to every
dwc3-applecontroller. If some SoCs are known to resume from L1 correctly, I can narrow it.Refs #380. Maintainers are welcome to push to this branch or take the change over.
🤖 Generated with Claude Code