Skip to content

Commit 7cb8750

Browse files
Heikki Krogerusgregkh
authored andcommitted
usb: acpi: fix device link removal
commit 3b18405 upstream. 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 <stable@kernel.org> Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Link: https://lore.kernel.org/r/20250611111415.2707865-1-heikki.krogerus@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c68a27b commit 7cb8750

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
@@ -2336,6 +2336,9 @@ void usb_disconnect(struct usb_device **pdev)
23362336
usb_remove_ep_devs(&udev->ep0);
23372337
usb_unlock_device(udev);
23382338

2339+
if (udev->usb4_link)
2340+
device_link_del(udev->usb4_link);
2341+
23392342
/* Unregister the device. The device driver is responsible
23402343
* for de-configuring the device and invoking the remove-device
23412344
* 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
@@ -612,6 +612,7 @@ struct usb3_lpm_parameters {
612612
* FIXME -- complete doc
613613
* @authenticated: Crypto authentication passed
614614
* @tunnel_mode: Connection native or tunneled over USB4
615+
* @usb4_link: device link to the USB4 host interface
615616
* @lpm_capable: device supports LPM
616617
* @lpm_devinit_allow: Allow USB3 device initiated LPM, exit latency is in range
617618
* @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
@@ -722,6 +723,7 @@ struct usb_device {
722723
unsigned reset_resume:1;
723724
unsigned port_is_suspended:1;
724725
enum usb_link_tunnel_mode tunnel_mode;
726+
struct device_link *usb4_link;
725727

726728
int slot_id;
727729
struct usb2_lpm_parameters l1_params;

0 commit comments

Comments
 (0)