]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xhci: get rid of XHCI_PLAT quirk that used to prevent MSI setup
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 2 Jun 2023 14:40:02 +0000 (17:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:32:31 +0000 (17:32 +0200)
[ Upstream commit 0a4776205b16d038ec6fedef2094951fcb6f441b ]

The XHCI_PLAT quirk was only needed to ensure non-PCI xHC host avoided
setting up MSI interrupts in generic xhci codepaths.

The MSI setup code is now moved to PCI specific xhci-pci.c file so
the quirk is no longer needed.

Remove setting the XHCI_PLAT quirk for HiSilocon SoC xHC, NVIDIA Tegra xHC,
MediaTek xHC, the generic xhci-plat driver, and the checks for XHCI_PLAT
in xhci-pci.c MSI setup code.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-5-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/host/xhci-histb.c
drivers/usb/host/xhci-mtk.c
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-plat.c
drivers/usb/host/xhci-tegra.c
drivers/usb/host/xhci.h

index 91ce97821de5180d62b9685f575b6b23a1fdbf15..7c204775508301e9a0dcb1d8d08479b0f54f65de 100644 (file)
@@ -164,16 +164,6 @@ static void xhci_histb_host_disable(struct xhci_hcd_histb *histb)
        clk_disable_unprepare(histb->bus_clk);
 }
 
-static void xhci_histb_quirks(struct device *dev, struct xhci_hcd *xhci)
-{
-       /*
-        * As of now platform drivers don't provide MSI support so we ensure
-        * here that the generic code does not try to make a pci_dev from our
-        * dev struct in order to setup MSI
-        */
-       xhci->quirks |= XHCI_PLAT;
-}
-
 /* called during probe() after chip reset completes */
 static int xhci_histb_setup(struct usb_hcd *hcd)
 {
@@ -186,7 +176,7 @@ static int xhci_histb_setup(struct usb_hcd *hcd)
                        return ret;
        }
 
-       return xhci_gen_setup(hcd, xhci_histb_quirks);
+       return xhci_gen_setup(hcd, NULL);
 }
 
 static const struct xhci_driver_overrides xhci_histb_overrides __initconst = {
index b60521e1a9a63ae3a7ceefdc578ae5d5fa748829..9a40da3b0064b3690eb2c4ca6194076322d58afa 100644 (file)
@@ -418,12 +418,6 @@ static void xhci_mtk_quirks(struct device *dev, struct xhci_hcd *xhci)
        struct usb_hcd *hcd = xhci_to_hcd(xhci);
        struct xhci_hcd_mtk *mtk = hcd_to_mtk(hcd);
 
-       /*
-        * As of now platform drivers don't provide MSI support so we ensure
-        * here that the generic code does not try to make a pci_dev from our
-        * dev struct in order to setup MSI
-        */
-       xhci->quirks |= XHCI_PLAT;
        xhci->quirks |= XHCI_MTK_HOST;
        /*
         * MTK host controller gives a spurious successful event after a
index db9826c38b20b1bff35e41a2e4e7b7549278e4fa..9540f0e48c21582580d75deb7b9cc61fae7d1a3c 100644 (file)
@@ -108,9 +108,6 @@ static void xhci_cleanup_msix(struct xhci_hcd *xhci)
        struct usb_hcd *hcd = xhci_to_hcd(xhci);
        struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
 
-       if (xhci->quirks & XHCI_PLAT)
-               return;
-
        /* return if using legacy interrupt */
        if (hcd->irq > 0)
                return;
@@ -208,10 +205,6 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
        struct pci_dev  *pdev;
        int ret;
 
-       /* The xhci platform device has set up IRQs through usb_add_hcd. */
-       if (xhci->quirks & XHCI_PLAT)
-               return 0;
-
        pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
        /*
         * Some Fresco Logic host controllers advertise MSI, but fail to
index f36633fa83624f1e2bceffd4bb8679ac62804c1f..80da67a6c3bf27bdc7769f18c4804248717cb4b4 100644 (file)
@@ -78,12 +78,7 @@ static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
        struct xhci_plat_priv *priv = xhci_to_priv(xhci);
 
-       /*
-        * As of now platform drivers don't provide MSI support so we ensure
-        * here that the generic code does not try to make a pci_dev from our
-        * dev struct in order to setup MSI
-        */
-       xhci->quirks |= XHCI_PLAT | priv->quirks;
+       xhci->quirks |= priv->quirks;
 }
 
 /* called during probe() after chip reset completes */
index d28fa892c286603597e481391a3be4f6c5e9e0c2..07a319db580343102275c51ab68338dd617911ed 100644 (file)
@@ -2662,7 +2662,6 @@ static void tegra_xhci_quirks(struct device *dev, struct xhci_hcd *xhci)
 {
        struct tegra_xusb *tegra = dev_get_drvdata(dev);
 
-       xhci->quirks |= XHCI_PLAT;
        if (tegra && tegra->soc->lpm_support)
                xhci->quirks |= XHCI_LPM_SUPPORT;
 }
index 4474d540f6b49ff3efdffc39b4db0b0eb672ab02..0b1928851a2a9fb8516f3d530a8ed983bf0ee130 100644 (file)
@@ -1874,7 +1874,7 @@ struct xhci_hcd {
 #define XHCI_SPURIOUS_REBOOT   BIT_ULL(13)
 #define XHCI_COMP_MODE_QUIRK   BIT_ULL(14)
 #define XHCI_AVOID_BEI         BIT_ULL(15)
-#define XHCI_PLAT              BIT_ULL(16)
+#define XHCI_PLAT              BIT_ULL(16) /* Deprecated */
 #define XHCI_SLOW_SUSPEND      BIT_ULL(17)
 #define XHCI_SPURIOUS_WAKEUP   BIT_ULL(18)
 /* For controllers with a broken beyond repair streams implementation */