Skip to contentSkip to conversation

xhci: Avoid USB autosuspend when resuming USB2 ports.

PATCH New Anshuman Gupta 1 participant 1 message Sep 19, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 xhci: Avoid USB autosuspend when resuming USB2 ports.

Quoted 30 lines · Mathias Nyman
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_resume API's in order to autoresume/autosuspend root hub properly.

Quoted 9 lines
Quoted 2 lines

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.

Quoted 8 lines

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?

This patch is not fixing any bug.
This patch provide improvement in runtime suspend/resume path of xhci.

Quoted 2 lines

-Mathias