diff options
authorGeorge Cherian2013-07-31 03:59:19 -0500
committerSomnath Mukherjee2013-08-09 00:26:09 -0500
commitfca727e66070b18b2fce6922efdf48cb61e01720 (patch)
parent5f00ae3ddba3ad66200c8e1eaf78399018bf7618 (diff)
usb: host: xhci: Enable XHCI_SPURIOUS_SUCCESS for all controllers with xhci 1.0
Xhci controllers with hci_version > 0.96 gives spurious success events on short packet completion. During webcam capture the "ERROR Transfer event TRB DMA ptr not part of current TD" was observed. The same application works fine with synopsis controllers hci_version 0.96. The same Issue is seen with Intel Pantherpoint xhci controller. So enabling this quirk in xhci_gen_setup if controller verion is greater than 0.96. For xhci-pci move the quirk to much generic place xhci_gen_setup. Note from Sarah: The xHCI 1.0 spec changed how hardware handles short packets. The HW will notify SW of the TRB where the short packet occurred, and it will also give a successful status for the last TRB in a TD (the one with the IOC flag set). On the second successful status, that warning will be triggered in the driver. Software is now supposed to not assume the TD is not completed until it gets that last successful status. That means we have a slight race condition, although it should have little practical impact. This patch papers over that issue. It's on my long-term to-do list to fix this race condition, but it is a much more involved patch that will probably be too big for stable. This patch is needed for stable to avoid serious log spam. This patch should be backported to kernels as old as 3.0, that contain the commit ad808333d8201d53075a11bc8dd83b81f3d68f0b "Intel xhci: Ignore spurious successful event." The patch will have to be modified for kernels older than 3.2, since that kernel added the xhci_gen_setup function for xhci platform devices. The correct conflict resolution for kernels older than 3.2 is to set XHCI_SPURIOUS_SUCCESS in xhci_pci_quirks for all xHCI 1.0 hosts. upstream-status: http://marc.info/?l=linux-usb&m=137265657724242&w=2 Change-Id: I4f5b93a6031118facd971985e40c77280e53ffe3 Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> [backported to 3.8] Signed-off-by: Ravi Babu <ravibabu@ti.com>
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
index af259e0ec172..b66037811aa5 100644
--- a/drivers/usb/host/xhci-pci.c
+++ b/drivers/usb/host/xhci-pci.c
@@ -93,7 +93,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
93 } 93 }
94 if (pdev->vendor == PCI_VENDOR_ID_INTEL && 94 if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
96 xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
97 xhci->quirks |= XHCI_EP_LIMIT_QUIRK; 96 xhci->quirks |= XHCI_EP_LIMIT_QUIRK;
98 xhci->limit_active_eps = 64; 97 xhci->limit_active_eps = 64;
99 xhci->quirks |= XHCI_SW_BW_CHECKING; 98 xhci->quirks |= XHCI_SW_BW_CHECKING;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 849470b18831..603bcca19a0a 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -4661,6 +4661,13 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
4661 4661
4662 get_quirks(dev, xhci); 4662 get_quirks(dev, xhci);
4663 4663
4664 /* In xhci controllers which follow xhci 1.0 spec gives a spurious
4665 * success event after a short transfer. This quirk will ignore such
4666 * spurious event.
4667 */
4668 if (xhci->hci_version > 0x96)
4669 xhci->quirks |= XHCI_SPURIOUS_SUCCESS;
4664 /* Make sure the HC is halted. */ 4671 /* Make sure the HC is halted. */
4665 retval = xhci_halt(xhci); 4672 retval = xhci_halt(xhci);
4666 if (retval) 4673 if (retval)