diff options
author | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2012-07-25 13:52:45 -0400 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2012-08-07 13:56:31 -0400 |
commit | 8202ce2e2921941098aa72894ac5d7b486a9d273 (patch) | |
tree | fddb68a93b7d9c470bd17ac388cd89473bef22b8 /drivers/usb | |
parent | 5cb7df2b2d3afee7638b3ef23a5bcb89c6f07bd9 (diff) |
xhci: Rate-limit XHCI_TRUST_TX_LENGTH quirk warning.
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 4 | ||||
-rw-r--r-- | drivers/usb/host/xhci.h | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 8275645889da..0c93f5dcea6f 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -2073,8 +2073,8 @@ static int handle_tx_event(struct xhci_hcd *xhci, | |||
2073 | if (xhci->quirks & XHCI_TRUST_TX_LENGTH) | 2073 | if (xhci->quirks & XHCI_TRUST_TX_LENGTH) |
2074 | trb_comp_code = COMP_SHORT_TX; | 2074 | trb_comp_code = COMP_SHORT_TX; |
2075 | else | 2075 | else |
2076 | xhci_warn(xhci, "WARN Successful completion on short TX: " | 2076 | xhci_warn_ratelimited(xhci, |
2077 | "needs XHCI_TRUST_TX_LENGTH quirk?\n"); | 2077 | "WARN Successful completion on short TX: needs XHCI_TRUST_TX_LENGTH quirk?\n"); |
2078 | case COMP_SHORT_TX: | 2078 | case COMP_SHORT_TX: |
2079 | break; | 2079 | break; |
2080 | case COMP_STOP: | 2080 | case COMP_STOP: |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 55c0785810c9..96f49dbb50ac 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1537,6 +1537,8 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) | |||
1537 | dev_err(xhci_to_hcd(xhci)->self.controller , fmt , ## args) | 1537 | dev_err(xhci_to_hcd(xhci)->self.controller , fmt , ## args) |
1538 | #define xhci_warn(xhci, fmt, args...) \ | 1538 | #define xhci_warn(xhci, fmt, args...) \ |
1539 | dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args) | 1539 | dev_warn(xhci_to_hcd(xhci)->self.controller , fmt , ## args) |
1540 | #define xhci_warn_ratelimited(xhci, fmt, args...) \ | ||
1541 | dev_warn_ratelimited(xhci_to_hcd(xhci)->self.controller , fmt , ## args) | ||
1540 | 1542 | ||
1541 | /* TODO: copied from ehci.h - can be refactored? */ | 1543 | /* TODO: copied from ehci.h - can be refactored? */ |
1542 | /* xHCI spec says all registers are little endian */ | 1544 | /* xHCI spec says all registers are little endian */ |