xhci: Avoid USB autosuspend when resuming USB2 ports.
PATCH 2/3 xhci: Avoid USB autosuspend when resuming USB2 ports.
Quoted 16 lines · Greg KH
Quoted 15 lines · Mathias Nyman
From: Anshuman Gupta <[email protected]>
When USB bus host controller root hub resumes from autosuspend, it immediately tries to enter auto-suspend, but there can be a scenario when root hub is resuming its usb2 ports, in that particular case USB host controller auto suspend fails since it is busy to resuming its usb2 ports.
This makes multiple failed cycles of auto-suspend until all usb2 ports of host controller root hub do not resume.
This patch uses USB core framework
usb_hcd_start_port_resume,usb_hcd_end_port_resumeAPI's in order to autoresume/autosuspend root hub properly.
Quoted 9 lines
Quoted 2 lines
Signed-off-by Anshuman Gupta <[email protected]>Signed-off-by Mathias Nyman <[email protected]>Not needed in stable? Does this fix a specific commit?
thanks,
greg k-h
This improves a bad initial design that prevented autosuspend by returning -EBUSY in xhci_bus_suspend() if a usb2 port was resuming.
Instead increment usage count on the roothub to prevent pm from polling xhci_bus_suspend(). This is also what EHCI does.
I'm not sure If this fixes a actual bug for Anshuman Gupta caused by the -EBUSY polling,(4.19 +stable), or if this is just a improvement in suspend/resume code for xhci (4.20).
Anshuman Gupta, any comments?
-Mathias