Skip to content

Commit 8101c05

Browse files
Peter Chengregkh
authored andcommitted
usb: xhci: omit duplicate actions when suspending a runtime suspended host.
[ Upstream commit 18a367e ] If the xhci-plat.c is the platform driver, after the runtime pm is enabled, the xhci_suspend is called if nothing is connected on the port. When the system goes to suspend, it will call xhci_suspend again if USB wakeup is enabled. Since the runtime suspend wakeup setting is not always the same as system suspend wakeup setting, eg, at runtime suspend we always need wakeup if the controller is in low power mode; but at system suspend, we may not need wakeup. So, we move the judgement after changing wakeup setting. [commit message rewording -Mathias] Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20200918131752.16488-8-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d980c86 commit 8101c05

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/usb/host/xhci.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,12 +982,15 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup)
982982
xhci->shared_hcd->state != HC_STATE_SUSPENDED)
983983
return -EINVAL;
984984

985-
xhci_dbc_suspend(xhci);
986-
987985
/* Clear root port wake on bits if wakeup not allowed. */
988986
if (!do_wakeup)
989987
xhci_disable_port_wake_on_bits(xhci);
990988

989+
if (!HCD_HW_ACCESSIBLE(hcd))
990+
return 0;
991+
992+
xhci_dbc_suspend(xhci);
993+
991994
/* Don't poll the roothubs on bus suspend. */
992995
xhci_dbg(xhci, "%s: stopping port polling.\n", __func__);
993996
clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);

0 commit comments

Comments
 (0)