aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2017-12-01 06:41:19 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-12-01 10:24:58 -0500
commite4ec40ec4b260efcca15089de4285a0a3411259b (patch)
treec93e999b4e017747cfd924e3adeac0c29489442c
parent1ac7c8a78be85f84b019d3d2742d1a9f07255cc5 (diff)
xhci: Don't show incorrect WARN message about events for empty rings
xHC can generate two events for a short transfer if the short TRB and last TRB in the TD are not the same TRB. The driver will handle the TD after the first short event, and remove it from its internal list. Driver then incorrectly prints a warning for the second event: "WARN Event TRB for slot x ep y with no TDs queued" Fix this by not printing a warning if we get a event on a empty list if the previous event was a short event. Cc: <stable@vger.kernel.org> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/host/xhci-ring.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index c239c688076c..6eb87c6e4d24 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2477,12 +2477,16 @@ static int handle_tx_event(struct xhci_hcd *xhci,
2477 */ 2477 */
2478 if (list_empty(&ep_ring->td_list)) { 2478 if (list_empty(&ep_ring->td_list)) {
2479 /* 2479 /*
2480 * A stopped endpoint may generate an extra completion 2480 * Don't print wanings if it's due to a stopped endpoint
2481 * event if the device was suspended. Don't print 2481 * generating an extra completion event if the device
2482 * warnings. 2482 * was suspended. Or, a event for the last TRB of a
2483 * short TD we already got a short event for.
2484 * The short TD is already removed from the TD list.
2483 */ 2485 */
2486
2484 if (!(trb_comp_code == COMP_STOPPED || 2487 if (!(trb_comp_code == COMP_STOPPED ||
2485 trb_comp_code == COMP_STOPPED_LENGTH_INVALID)) { 2488 trb_comp_code == COMP_STOPPED_LENGTH_INVALID ||
2489 ep_ring->last_td_was_short)) {
2486 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n", 2490 xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n",
2487 TRB_TO_SLOT_ID(le32_to_cpu(event->flags)), 2491 TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
2488 ep_index); 2492 ep_index);