Skip to content

Commit 623dae3

Browse files
matnymangregkh
authored andcommitted
usb: acpi: fix boot hang due to early incorrect 'tunneled' USB3 device links
Fix a boot hang issue triggered when a USB3 device is incorrectly assumed to be tunneled over USB4, thus attempting to create a device link between the USB3 "consumer" device and the USB4 "supplier" Host Interface before the USB4 side is properly bound to a driver. This could happen if xhci isn't capable of detecting tunneled devices, but ACPI tables contain all info needed to assume device is tunneled. i.e. udev->tunnel_mode == USB_LINK_UNKNOWN. It turns out that even for actual tunneled USB3 devices it can't be assumed that the thunderbolt driver providing the tunnel is loaded before the tunneled USB3 device is created. The tunnel can be created by BIOS and remain in use by thunderbolt/USB4 host driver once it loads. Solve this by making the device link "stateless", which doesn't create a driver presence order dependency between the supplier and consumer drivers. It still guarantees correct suspend/resume and shutdown ordering. cc: Mario Limonciello <[email protected]> Fixes: f1bfb4a ("usb: acpi: add device link between tunneled USB3 device and USB4 Host Interface") Tested-by: Harry Wentland <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Tested-by: Mario Limonciello <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f3b3113 commit 623dae3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/core/usb-acpi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ static int usb_acpi_add_usb4_devlink(struct usb_device *udev)
170170
struct fwnode_handle *nhi_fwnode __free(fwnode_handle) =
171171
fwnode_find_reference(dev_fwnode(&port_dev->dev), "usb4-host-interface", 0);
172172

173-
if (IS_ERR(nhi_fwnode))
173+
if (IS_ERR(nhi_fwnode) || !nhi_fwnode->dev)
174174
return 0;
175175

176176
link = device_link_add(&port_dev->child->dev, nhi_fwnode->dev,
177-
DL_FLAG_AUTOREMOVE_CONSUMER |
177+
DL_FLAG_STATELESS |
178178
DL_FLAG_RPM_ACTIVE |
179179
DL_FLAG_PM_RUNTIME);
180180
if (!link) {

0 commit comments

Comments
 (0)