Skip to content

Commit 3b18405

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: acpi: fix device link removal
The device link to the USB4 host interface has to be removed manually since it's no longer auto removed. Fixes: 623dae3 ("usb: acpi: fix boot hang due to early incorrect 'tunneled' USB3 device links") Cc: stable <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8f5b7e2 commit 3b18405

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

drivers/usb/core/hub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,6 +2368,9 @@ void usb_disconnect(struct usb_device **pdev)
23682368
usb_remove_ep_devs(&udev->ep0);
23692369
usb_unlock_device(udev);
23702370

2371+
if (udev->usb4_link)
2372+
device_link_del(udev->usb4_link);
2373+
23712374
/* Unregister the device. The device driver is responsible
23722375
* for de-configuring the device and invoking the remove-device
23732376
* notifier chain (used by usbfs and possibly others).

drivers/usb/core/usb-acpi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ EXPORT_SYMBOL_GPL(usb_acpi_set_power_state);
157157
*/
158158
static int usb_acpi_add_usb4_devlink(struct usb_device *udev)
159159
{
160-
const struct device_link *link;
160+
struct device_link *link;
161161
struct usb_port *port_dev;
162162
struct usb_hub *hub;
163163

@@ -188,6 +188,8 @@ static int usb_acpi_add_usb4_devlink(struct usb_device *udev)
188188
dev_dbg(&port_dev->dev, "Created device link from %s to %s\n",
189189
dev_name(&port_dev->child->dev), dev_name(nhi_fwnode->dev));
190190

191+
udev->usb4_link = link;
192+
191193
return 0;
192194
}
193195

include/linux/usb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ struct usb3_lpm_parameters {
614614
* FIXME -- complete doc
615615
* @authenticated: Crypto authentication passed
616616
* @tunnel_mode: Connection native or tunneled over USB4
617+
* @usb4_link: device link to the USB4 host interface
617618
* @lpm_capable: device supports LPM
618619
* @lpm_devinit_allow: Allow USB3 device initiated LPM, exit latency is in range
619620
* @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
@@ -724,6 +725,7 @@ struct usb_device {
724725
unsigned reset_resume:1;
725726
unsigned port_is_suspended:1;
726727
enum usb_link_tunnel_mode tunnel_mode;
728+
struct device_link *usb4_link;
727729

728730
int slot_id;
729731
struct usb2_lpm_parameters l1_params;

0 commit comments

Comments
 (0)