[PATCH 2/2] xHCI: fix bug of resume for VIA xHCI host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The Save/Restore state funtion of VIA xHCI host is unstable. So add
the XHCI_RESET_ON_RESUME quirk for it.

When driver free Event Ring in the resume procedure, driver can't
write zero to Event Ring Registers in VIA xHCI host, otherwise the
VIA host can't be resumed.

Signed-off-by: Elric Fu <elricfu1@xxxxxxxxx>
---
 drivers/usb/host/xhci-mem.c |    2 +-
 drivers/usb/host/xhci-pci.c |    1 +
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 383fc85..9321837 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1690,7 +1690,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci)
 	int i;
 
 	/* Free the Event Ring Segment Table and the actual Event Ring */
-	if (xhci->ir_set) {
+	if (xhci->ir_set && !(xhci->quirks & XHCI_VIA_HOST)) {
 		xhci_writel(xhci, 0, &xhci->ir_set->erst_size);
 		xhci_write_64(xhci, 0, &xhci->ir_set->erst_base);
 		xhci_write_64(xhci, 0, &xhci->ir_set->erst_dequeue);
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index 872d024..75350ea 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -106,6 +106,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
 	}
 	if (pdev->vendor == PCI_VENDOR_ID_VIA) {
 		xhci->quirks |= XHCI_VIA_HOST;
+		xhci->quirks |= XHCI_RESET_ON_RESUME;
 		xhci_via_get_fw(xhci, pdev);
 	}
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux