Don't trace unexpected incomplete receives if the XHCI_TRUST_RX_LENGTH is set. Don't trace short receives if URB_SHORT_NOT_OK is set. Short receives are normal for USB ethernet devices. Ratelimit both traces. Signed-off-by: David Laight <david.laight@xxxxxxxxxx> --- This is dependent on my previous patch to rename XHCI_TRUST_TX_LENGTH to XHCI_TRUST_RX_LENGTH. This replaces most of the rest of my earlier patch: [PATCH] usb: xhci: Less verbose tracing of short receives drivers/usb/host/xhci-ring.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 2031dc3..2315be1 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2308,36 +2308,34 @@ static int process_bulk_intr_td(struct xhci_hcd *xhci, struct xhci_td *td, switch (trb_comp_code) { case COMP_SUCCESS: /* Double check that the HW transferred everything. */ - if (event_trb != td->last_trb || - EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { - xhci_warn(xhci, "WARN Successful completion " - "on short TX\n"); - if (td->urb->transfer_flags & URB_SHORT_NOT_OK) - *status = -EREMOTEIO; - else - *status = 0; - if ((xhci->quirks & XHCI_TRUST_RX_LENGTH)) - trb_comp_code = COMP_SHORT_RX; - } else { + if (event_trb == td->last_trb && + EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) == 0) { *status = 0; + break; } - break; + if (xhci->quirks & XHCI_TRUST_RX_LENGTH) + trb_comp_code = COMP_SHORT_RX; + else + xhci_warn_ratelimited(xhci, + "WARN Successful completion on short RX: needs XHCI_TRUST_RX_LENGTH quirk?\n"); + /* FALLTHROUGH */ case COMP_SHORT_RX: - if (td->urb->transfer_flags & URB_SHORT_NOT_OK) + if (td->urb->transfer_flags & URB_SHORT_NOT_OK) { + xhci_dbg(xhci, "ep %#x - asked for %d bytes, " + "%d bytes not received\n", + td->urb->ep->desc.bEndpointAddress, + td->urb->transfer_buffer_length, + EVENT_TRB_LEN(le32_to_cpu(event->transfer_len))); *status = -EREMOTEIO; - else + } else { *status = 0; + } break; default: /* Others already handled above */ break; } - if (trb_comp_code == COMP_SHORT_RX) - xhci_dbg(xhci, "ep %#x - asked for %d bytes, " - "%d bytes untransferred\n", - td->urb->ep->desc.bEndpointAddress, - td->urb->transfer_buffer_length, - EVENT_TRB_LEN(le32_to_cpu(event->transfer_len))); + /* Fast path - was this the last TRB in the TD for this URB? */ if (event_trb == td->last_trb) { if (EVENT_TRB_LEN(le32_to_cpu(event->transfer_len)) != 0) { -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html