diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 34f16ba1b104..10612f8f3caf 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5269,7 +5269,24 @@ static void port_event(struct usb_hub *hub, int port1) } else { usb_unlock_port(port_dev); usb_lock_device(udev); - usb_reset_device(udev); + + /** + * Some special SoCs (e.g. rk322xh) USB3 PHY lose the + * ability to detect a disconnection when USB3 device + * plug out, fortunately, it can detect port link state + * change here, so we can do soft disconnect according + * to the PLC here. + * + * And we only need to do the soft disconnect for root + * hub. In addition, we just reuse the autosuspend quirk + * but not add a new quirk for this issue. Because this + * issue always occurs with autosuspend problem. + */ + if (!hub->hdev->parent && (hdev->quirks & + USB_QUIRK_AUTO_SUSPEND)) + usb_remove_device(udev); + else + usb_reset_device(udev); usb_unlock_device(udev); usb_lock_port(port_dev); connect_change = 0;