Skip to content

Commit 9c74599

Browse files
jwrdegoedeSarah Sharp
authored andcommitted
usb-xhci: Handle COMP_TX_ERR for isoc tds
While testing unplugging an UVC HD webcam with usb-redirection (so through usbdevfs), my userspace usb-redir code was getting a value of -1 in iso_frame_desc[n].status, which according to Documentation/usb/error-codes.txt is not a valid value. The source of this -1 is the default case in xhci-ring.c:process_isoc_td() adding a kprintf there showed the value of trb_comp_code to be COMP_TX_ERR in this case, so this patch adds handling for that completion code to process_isoc_td(). This was observed and tested with the following xhci controller: 1033:0194 NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04) Note: I also wonder if setting frame->status to -1 (-EPERM) is the best we can do, but since I cannot come up with anything better I've left that as is. This patch should be backported to kernels as old as 2.6.36, which contain the commit 04e5190 "USB: xHCI: Isochronous transfer implementation". Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Sarah Sharp <[email protected]> Cc: [email protected]
1 parent f370b99 commit 9c74599

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/host/xhci-ring.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,6 +1804,7 @@ static int process_isoc_td(struct xhci_hcd *xhci, struct xhci_td *td,
18041804
break;
18051805
case COMP_DEV_ERR:
18061806
case COMP_STALL:
1807+
case COMP_TX_ERR:
18071808
frame->status = -EPROTO;
18081809
skip_td = true;
18091810
break;

0 commit comments

Comments
 (0)