mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-09 10:09:11 +00:00
usb: core: hub: fix race condition about TRSMRCY of resume
commit 975f94c7d6
upstream.
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: <stable@vger.kernel.org>
Reported-by: Tianping Fang <tianping.fang@mediatek.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20210512020738.52961-1-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
45ad6b592e
commit
9238492b9a
1 changed files with 3 additions and 3 deletions
|
@ -3592,9 +3592,6 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
|
|||
* sequence.
|
||||
*/
|
||||
status = hub_port_status(hub, port1, &portstatus, &portchange);
|
||||
|
||||
/* TRSMRCY = 10 msec */
|
||||
msleep(10);
|
||||
}
|
||||
|
||||
SuspendCleared:
|
||||
|
@ -3609,6 +3606,9 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
|
|||
usb_clear_port_feature(hub->hdev, port1,
|
||||
USB_PORT_FEAT_C_SUSPEND);
|
||||
}
|
||||
|
||||
/* TRSMRCY = 10 msec */
|
||||
msleep(10);
|
||||
}
|
||||
|
||||
if (udev->persist_enabled)
|
||||
|
|
Loading…
Reference in a new issue