Skip to content

Commit d68cc25

Browse files
jannaugregkh
authored andcommitted
usb: dwc3: Do not get extcon device when usb-role-switch is used
The change breaks device tree based platforms with PHY device and use usb-role-switch instead of an extcon switch. extcon_find_edev_by_node() will return EPROBE_DEFER if it can not find a device so probing without an extcon device will be deferred indefinitely. Fix this by explicitly checking for usb-role-switch. At least the out-of-tree USB3 support on Apple silicon based platforms using dwc3 with tipd USB Type-C and PD controller is affected by this issue. Fixes: d182c2e ("usb: dwc3: Don't switch OTG -> peripheral if extcon is present") Cc: [email protected] Signed-off-by: Janne Grunau <[email protected]> Acked-by: Thinh Nguyen <[email protected]> Reviewed-by: Sven Peter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 6d8fc20 commit d68cc25

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/usb/dwc3/core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1710,6 +1710,16 @@ static struct extcon_dev *dwc3_get_extcon(struct dwc3 *dwc)
17101710
if (device_property_read_string(dev, "linux,extcon-name", &name) == 0)
17111711
return extcon_get_extcon_dev(name);
17121712

1713+
/*
1714+
* Check explicitly if "usb-role-switch" is used since
1715+
* extcon_find_edev_by_node() can not be used to check the absence of
1716+
* an extcon device. In the absence of an device it will always return
1717+
* EPROBE_DEFER.
1718+
*/
1719+
if (IS_ENABLED(CONFIG_USB_ROLE_SWITCH) &&
1720+
device_property_read_bool(dev, "usb-role-switch"))
1721+
return NULL;
1722+
17131723
/*
17141724
* Try to get an extcon device from the USB PHY controller's "port"
17151725
* node. Check if it has the "port" node first, to avoid printing the

0 commit comments

Comments
 (0)