Skip to content

Commit 975f94c

Browse files
Chunfeng Yungregkh
authored andcommitted
usb: core: hub: fix race condition about TRSMRCY of resume
This may happen if the port becomes resume status exactly when usb_port_resume() gets port status, it still need provide a TRSMCRY time before access the device. CC: <[email protected]> Reported-by: Tianping Fang <[email protected]> Acked-by: Alan Stern <[email protected]> Signed-off-by: Chunfeng Yun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 12701ce commit 975f94c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/usb/core/hub.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3642,9 +3642,6 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
36423642
* sequence.
36433643
*/
36443644
status = hub_port_status(hub, port1, &portstatus, &portchange);
3645-
3646-
/* TRSMRCY = 10 msec */
3647-
msleep(10);
36483645
}
36493646

36503647
SuspendCleared:
@@ -3659,6 +3656,9 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
36593656
usb_clear_port_feature(hub->hdev, port1,
36603657
USB_PORT_FEAT_C_SUSPEND);
36613658
}
3659+
3660+
/* TRSMRCY = 10 msec */
3661+
msleep(10);
36623662
}
36633663

36643664
if (udev->persist_enabled)

0 commit comments

Comments
 (0)