diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2017-03-28 08:55:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-29 06:13:49 -0400 |
commit | 0ab2881a406b9fd46224a3e8253bbc0141b4f844 (patch) | |
tree | 9d76cab2f9b5e06fc230ec5679f2c39590818417 | |
parent | b07c12517f2aed0add8ce18146bb426b14099392 (diff) |
xhci: Set URB actual length for stopped control transfers
A control transfer that stopped at the status stage incorrectly
warned about a "unexpected TRB Type 4", and did not set the
transferred actual_length for the URB.
The URB actual_length for control transfers should contain the
bytes transferred in the data stage.
Bytes of a partially sent setup stage and missing bytes from
status stage should be left out.
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.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index d9936c771fa0..a3309aa02993 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c | |||
@@ -1989,6 +1989,9 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct xhci_td *td, | |||
1989 | case TRB_NORMAL: | 1989 | case TRB_NORMAL: |
1990 | td->urb->actual_length = requested - remaining; | 1990 | td->urb->actual_length = requested - remaining; |
1991 | goto finish_td; | 1991 | goto finish_td; |
1992 | case TRB_STATUS: | ||
1993 | td->urb->actual_length = requested; | ||
1994 | goto finish_td; | ||
1992 | default: | 1995 | default: |
1993 | xhci_warn(xhci, "WARN: unexpected TRB Type %d\n", | 1996 | xhci_warn(xhci, "WARN: unexpected TRB Type %d\n", |
1994 | trb_type); | 1997 | trb_type); |