Skip to content

Commit cfc8f2c

Browse files
Sarah Sharpgregkh
Sarah Sharp
authored andcommitted
xhci: Don't warn on empty ring for suspended devices.
commit a83d675 upstream. When a device attached to the roothub is suspended, the endpoint rings are stopped. The host may generate a completion event with the completion code set to 'Stopped' or 'Stopped Invalid' when the ring is halted. The current xHCI code prints a warning in that case, which can be really annoying if the USB device is coming into and out of suspend. Remove the unnecessary warning. Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com> Tested-by: Stephen Hemminger <stephen@networkplumber.org> Cc: Luis Henriques <luis.henriques@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b241f9d commit cfc8f2c

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,14 +2461,21 @@ static int handle_tx_event(struct xhci_hcd *xhci,
24612461
* TD list.
24622462
*/
24632463
if (list_empty(&ep_ring->td_list)) {
2464-
xhci_warn(xhci, "WARN Event TRB for slot %d ep %d "
2465-
"with no TDs queued?\n",
2466-
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
2467-
ep_index);
2468-
xhci_dbg(xhci, "Event TRB with TRB type ID %u\n",
2469-
(le32_to_cpu(event->flags) &
2470-
TRB_TYPE_BITMASK)>>10);
2471-
xhci_print_trb_offsets(xhci, (union xhci_trb *) event);
2464+
/*
2465+
* A stopped endpoint may generate an extra completion
2466+
* event if the device was suspended. Don't print
2467+
* warnings.
2468+
*/
2469+
if (!(trb_comp_code == COMP_STOP ||
2470+
trb_comp_code == COMP_STOP_INVAL)) {
2471+
xhci_warn(xhci, "WARN Event TRB for slot %d ep %d with no TDs queued?\n",
2472+
TRB_TO_SLOT_ID(le32_to_cpu(event->flags)),
2473+
ep_index);
2474+
xhci_dbg(xhci, "Event TRB with TRB type ID %u\n",
2475+
(le32_to_cpu(event->flags) &
2476+
TRB_TYPE_BITMASK)>>10);
2477+
xhci_print_trb_offsets(xhci, (union xhci_trb *) event);
2478+
}
24722479
if (ep->skip) {
24732480
ep->skip = false;
24742481
xhci_dbg(xhci, "td_list is empty while skip "

0 commit comments

Comments
 (0)