xhci: Rate-limit XHCI_TRUST_TX_LENGTH quirk warning.
authorSarah Sharp <sarah.a.sharp@linux.intel.com>
Wed, 25 Jul 2012 17:52:45 +0000 (10:52 -0700)
committerSarah Sharp <sarah.a.sharp@linux.intel.com>
Tue, 7 Aug 2012 17:56:31 +0000 (10:56 -0700)
When we encounter an xHCI host that needs the XHCI_TRUST_TX_LENGTH
quirk, the xHCI driver ends up spewing messages about the quirk into
dmesg every time a short packet occurs.  Change the xHCI driver to
rate-limit such warnings.

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Matthew Hall <mhall@mhcomputing.net>
Reported-by: Gary E. Miller <gem@rellim.com>
drivers/usb/host/xhci-ring.c
drivers/usb/host/xhci.h

index 8275645889da4ce779c08c88ac4ea06473f222e0..0c93f5dcea6f5e8a58c5542688f25d9aba9e0573 100644 (file)
@@ -2073,8 +2073,8 @@ static int handle_tx_event(struct xhci_hcd *xhci,
                if (xhci->quirks & XHCI_TRUST_TX_LENGTH)
                        trb_comp_code = COMP_SHORT_TX;
                else
-                       xhci_warn(xhci, "WARN Successful completion on short TX: "
-                                       "needs XHCI_TRUST_TX_LENGTH quirk?\n");
+                       xhci_warn_ratelimited(xhci,
+                                       "WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk?\n");
        case COMP_SHORT_TX:
                break;
        case COMP_STOP:
index 55c0785810c99fb5286e29d39cd4d7ff2b98addb..96f49dbb50acf28dc115c170814603b75bd8403b 100644 (file)
@@ -1537,6 +1537,8 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci)
        dev_err(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
 #define xhci_warn(xhci, fmt, args...) \
        dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
+#define xhci_warn_ratelimited(xhci, fmt, args...) \
+       dev_warn_ratelimited(xhci_to_hcd(xhci)->self.controller , fmt , ## args)
 
 /* TODO: copied from ehci.h - can be refactored? */
 /* xHCI spec says all registers are little endian */