]> git.itanic.dy.fi Git - linux-stable/commitdiff
xhci: Remove quirk for over 10 year old evaluation hardware
authorMathias Nyman <mathias.nyman@linux.intel.com>
Wed, 11 May 2022 22:04:49 +0000 (01:04 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 16:32:25 +0000 (18:32 +0200)
The XHCI_RESET_EP_QUIRK was added in 2009 to support prototype xHC
hardware from Fresco Logic that needed an additional configure endpoint
command after a reset endpoint.

That hardware should not have made it to the market.
Now, 13 years later its about time we get rid of it.

quirk was added in commit ac9d8fe7c6a8 ("USB: xhci: Add quirk for Fresco
Logic xHCI hardware.")

Print a debug message about the removed quirk if against all odds we run
into this controller.

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20220511220450.85367-9-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-pci.c
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.h

index d7e0e6ebf0800e8e1e23d35d1cd6cc76bf7ed613..49ba94de74599ffc5547bf76e9f330408d157a8f 100644 (file)
@@ -129,8 +129,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
                                pdev->revision == 0x0) {
                        xhci->quirks |= XHCI_RESET_EP_QUIRK;
                        xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
-                               "QUIRK: Fresco Logic xHC needs configure"
-                               " endpoint cmd after reset endpoint");
+                               "XHCI_RESET_EP_QUIRK for this evaluation HW is deprecated");
                }
                if (pdev->device == PCI_DEVICE_ID_FRESCO_LOGIC_PDK &&
                                pdev->revision == 0x4) {
index 373e0e1528541b40efc938e4c22ecfcd8bbe9080..46d0b9ad6f743a7af4abd06d6b89aaae43af757b 100644 (file)
@@ -1426,8 +1426,6 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id,
        /* Cleanup cancelled TDs as ep is stopped. May queue a Set TR Deq cmd */
        xhci_invalidate_cancelled_tds(ep);
 
-       if (xhci->quirks & XHCI_RESET_EP_QUIRK)
-               xhci_dbg(xhci, "Note: Removed workaround to queue config ep for this hw");
        /* Clear our internal halted state */
        ep->ep_state &= ~EP_HALTED;
 
@@ -1471,17 +1469,13 @@ static void xhci_handle_cmd_config_ep(struct xhci_hcd *xhci, int slot_id,
        struct xhci_input_control_ctx *ctrl_ctx;
        struct xhci_ep_ctx *ep_ctx;
        unsigned int ep_index;
-       unsigned int ep_state;
-       u32 add_flags, drop_flags;
+       u32 add_flags;
 
        /*
-        * Configure endpoint commands can come from the USB core
-        * configuration or alt setting changes, or because the HW
-        * needed an extra configure endpoint command after a reset
-        * endpoint command or streams were being configured.
-        * If the command was for a halted endpoint, the xHCI driver
-        * is not waiting on the configure endpoint command.
+        * Configure endpoint commands can come from the USB core configuration
+        * or alt setting changes, or when streams were being configured.
         */
+
        virt_dev = xhci->devs[slot_id];
        if (!virt_dev)
                return;
@@ -1492,34 +1486,13 @@ static void xhci_handle_cmd_config_ep(struct xhci_hcd *xhci, int slot_id,
        }
 
        add_flags = le32_to_cpu(ctrl_ctx->add_flags);
-       drop_flags = le32_to_cpu(ctrl_ctx->drop_flags);
+
        /* Input ctx add_flags are the endpoint index plus one */
        ep_index = xhci_last_valid_endpoint(add_flags) - 1;
 
        ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->out_ctx, ep_index);
        trace_xhci_handle_cmd_config_ep(ep_ctx);
 
-       /* A usb_set_interface() call directly after clearing a halted
-        * condition may race on this quirky hardware.  Not worth
-        * worrying about, since this is prototype hardware.  Not sure
-        * if this will work for streams, but streams support was
-        * untested on this prototype.
-        */
-       if (xhci->quirks & XHCI_RESET_EP_QUIRK &&
-                       ep_index != (unsigned int) -1 &&
-                       add_flags - SLOT_FLAG == drop_flags) {
-               ep_state = virt_dev->eps[ep_index].ep_state;
-               if (!(ep_state & EP_HALTED))
-                       return;
-               xhci_dbg_trace(xhci, trace_xhci_dbg_quirks,
-                               "Completed config ep cmd - "
-                               "last ep index = %d, state = %d",
-                               ep_index, ep_state);
-               /* Clear internal halted state and restart ring(s) */
-               virt_dev->eps[ep_index].ep_state &= ~EP_HALTED;
-               ring_doorbell_for_active_rings(xhci, slot_id, ep_index);
-               return;
-       }
        return;
 }
 
index 1e3ef8d01567c8696e9182ffc2f83dd5a9c7b9ba..0bd76c94a4b154d59e5ce1f6cbcc513a2d009ed4 100644 (file)
@@ -1846,7 +1846,7 @@ struct xhci_hcd {
 #define XHCI_STATE_REMOVING    (1 << 2)
        unsigned long long      quirks;
 #define        XHCI_LINK_TRB_QUIRK     BIT_ULL(0)
-#define XHCI_RESET_EP_QUIRK    BIT_ULL(1)
+#define XHCI_RESET_EP_QUIRK    BIT_ULL(1) /* Deprecated */
 #define XHCI_NEC_HOST          BIT_ULL(2)
 #define XHCI_AMD_PLL_FIX       BIT_ULL(3)
 #define XHCI_SPURIOUS_SUCCESS  BIT_ULL(4)