usb: xhci: Set quirk for XHCI_SG_TRB_CACHE_SIZE_QUIRK
authorTejas Joglekar <Tejas.Joglekar@synopsys.com>
Tue, 8 Dec 2020 09:29:08 +0000 (11:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 13:32:00 +0000 (14:32 +0100)
This commit uses the private data passed by parent device
to set the quirk for Synopsys xHC. This patch fixes the
SNPS xHC hang issue when the data is scattered across
small buffers which does not make atleast MPS size for
given TRB cache size of SNPS xHC.

Signed-off-by: Tejas Joglekar <joglekar@synopsys.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20201208092912.1773650-2-mathias.nyman@linux.intel.com
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci.h

index aa2d35f982002ed5948f67cb4d7d470b4b74ad46..4d34f6005381e6eb1b9dab31dd2e5ec9180ab5e4 100644 (file)
@@ -333,6 +333,9 @@ static int xhci_plat_probe(struct platform_device *pdev)
        if (priv && (priv->quirks & XHCI_SKIP_PHY_INIT))
                hcd->skip_phy_initialization = 1;
 
+       if (priv && (priv->quirks & XHCI_SG_TRB_CACHE_SIZE_QUIRK))
+               xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK;
+
        ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
        if (ret)
                goto disable_usb_phy;
index ebb359ebb261c180e17cb1ee2c44ba6ee350999c..d90c0d5df3b37e8e9c603c6f20d8b4d8183282c0 100644 (file)
@@ -1878,6 +1878,7 @@ struct xhci_hcd {
 #define XHCI_RENESAS_FW_QUIRK  BIT_ULL(36)
 #define XHCI_SKIP_PHY_INIT     BIT_ULL(37)
 #define XHCI_DISABLE_SPARSE    BIT_ULL(38)
+#define XHCI_SG_TRB_CACHE_SIZE_QUIRK   BIT_ULL(39)
 
        unsigned int            num_active_eps;
        unsigned int            limit_active_eps;