Skip to content

Commit c6fd1e6

Browse files
LuBaolusashalevin
authored andcommitted
usb: xhci: set SSIC port unused only if xhci_suspend succeeds
[ Upstream commit 92149c9 ] XHCI_SSIC_PORT_UNUSED quirk was applied to the xHCI host controllers in some Intel SoC chips. With this quirk applied, SSIC port is set to "unused" prior to xhci_suspend(). This may cause problem if host fails to suspend. In this case, the port is set to unused without host further entering D3, and the port will not be usable anymore. Cc: [email protected] Signed-off-by: Zhuang Jin Can <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 1f8ad55 commit c6fd1e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
366366
{
367367
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
368368
struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
369+
int ret;
369370

370371
/*
371372
* Systems with the TI redriver that loses port status change events
@@ -380,7 +381,11 @@ static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
380381
if (xhci->quirks & XHCI_SSIC_PORT_UNUSED)
381382
xhci_ssic_port_unused_quirk(hcd, true);
382383

383-
return xhci_suspend(xhci, do_wakeup);
384+
ret = xhci_suspend(xhci, do_wakeup);
385+
if (ret && (xhci->quirks & XHCI_SSIC_PORT_UNUSED))
386+
xhci_ssic_port_unused_quirk(hcd, false);
387+
388+
return ret;
384389
}
385390

386391
static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)

0 commit comments

Comments
 (0)