Skip to content

Commit 455f589

Browse files
Oliver NeukumSarah Sharp
authored andcommitted
xhci: quirk for extra long delay for S4
It has been reported that this chipset really cannot sleep without this extraordinary delay. This patch should be backported, in order to ensure this host functions under stable kernels. The last quirk for Fresco Logic hosts (commit bba18e3 "xhci: Extend Fresco Logic MSI quirk.") was backported to stable kernels as old as 2.6.36. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
1 parent f217c98 commit 455f589

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
6969
"QUIRK: Fresco Logic xHC needs configure"
7070
" endpoint cmd after reset endpoint");
7171
}
72+
if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
73+
pdev->revision == 0x4) {
74+
xhci->quirks |= XHCI_SLOW_SUSPEND;
75+
xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
76+
"QUIRK: Fresco Logic xHC revision %u"
77+
"must be suspended extra slowly",
78+
pdev->revision);
79+
}
7280
/* Fresco Logic confirms: all revisions of this chip do not
7381
* support MSI, even though some of them claim to in their PCI
7482
* capabilities.

drivers/usb/host/xhci.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,7 @@ static void xhci_clear_command_ring(struct xhci_hcd *xhci)
839839
int xhci_suspend(struct xhci_hcd *xhci)
840840
{
841841
int rc = 0;
842+
unsigned int delay = XHCI_MAX_HALT_USEC;
842843
struct usb_hcd *hcd = xhci_to_hcd(xhci);
843844
u32 command;
844845

@@ -861,8 +862,12 @@ int xhci_suspend(struct xhci_hcd *xhci)
861862
command = xhci_readl(xhci, &xhci->op_regs->command);
862863
command &= ~CMD_RUN;
863864
xhci_writel(xhci, command, &xhci->op_regs->command);
865+
866+
/* Some chips from Fresco Logic need an extraordinary delay */
867+
delay *= (xhci->quirks & XHCI_SLOW_SUSPEND) ? 10 : 1;
868+
864869
if (xhci_handshake(xhci, &xhci->op_regs->status,
865-
STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC)) {
870+
STS_HALT, STS_HALT, delay)) {
866871
xhci_warn(xhci, "WARN: xHC CMD_RUN timeout\n");
867872
spin_unlock_irq(&xhci->lock);
868873
return -ETIMEDOUT;

drivers/usb/host/xhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@ struct xhci_hcd {
15481548
#define XHCI_COMP_MODE_QUIRK (1 << 14)
15491549
#define XHCI_AVOID_BEI (1 << 15)
15501550
#define XHCI_PLAT (1 << 16)
1551+
#define XHCI_SLOW_SUSPEND (1 << 17)
15511552
unsigned int num_active_eps;
15521553
unsigned int limit_active_eps;
15531554
/* There are two roothubs to keep track of bus suspend info for */

0 commit comments

Comments
 (0)