From fdb894d41960b331c4715353f23ecc0b44843780 Mon Sep 17 00:00:00 2001 From: Paul Cristian Date: Tue, 9 Jun 2026 09:33:55 +0200 Subject: [PATCH] phy: apple: atc: Fall back to USB2 when pipehandler state is DUMMY When DP alt mode is active on a TypeC port, atcphy is configured in DP mode and atcphy_modes[mode].pipehandler_state is ATCPHY_PIPEHANDLER_STATE_DUMMY. If DWC3/xHCI then calls phy_set_mode(PHY_MODE_USB_HOST) on the USB3 PHY, atcphy_configure_pipehandler() hits the default branch and returns -EINVAL. This propagates through usb_phy_roothub_set_mode() -> usb_add_hcd() as error -22, failing the entire xhci-hcd probe. USB2 data to the TypeC device is lost, even though D+/D- are unaffected by DP alt mode. Fix this by configuring the dummy pipehandler instead of returning -EINVAL. DUMMY pipehandler state means SS lanes are not available for USB3, so DWC3/xHCI initialises in USB2-only mode and devices enumerate normally. This is consistent with how ATCPHY_PIPEHANDLER_STATE_USB4 is already handled. Tested on apple,j413 (M2 MacBook Air 13") with DP alt mode active: xhci-hcd.3.auto now probes successfully and USB2 HID devices enumerate. Signed-off-by: Paul Cristian --- drivers/phy/apple/atc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c index 4f0585818fa7ac..40b87557daddb7 100644 --- a/drivers/phy/apple/atc.c +++ b/drivers/phy/apple/atc.c @@ -1137,7 +1137,13 @@ static int atcphy_configure_pipehandler(struct apple_atcphy *atcphy, bool host) atcphy->pipehandler_up = false; break; default: - ret = -EINVAL; + /* DUMMY pipehandler state (DP-only, USB2-only, OFF): SS lanes are + * not available for USB3. Configure dummy so DWC3/xHCI falls back + * to USB2-only operation instead of failing probe. + */ + ret = atcphy_configure_pipehandler_dummy(atcphy); + atcphy->pipehandler_up = false; + break; } return ret;