blob: f2f63485b5545c119e48c49cbfc8d8823fd1de2e [file] [log] [blame]
From a45cdd1c2e0fc7ad3a81d25a3603c42f2363460d Mon Sep 17 00:00:00 2001
From: Mathias Nyman <>
Date: Tue, 28 Mar 2017 15:55:29 +0300
Subject: [PATCH 215/255] xhci: Set URB actual length for stopped control
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: <>
Signed-off-by: Mathias Nyman <>
Signed-off-by: Greg Kroah-Hartman <>
(cherry picked from commit 0ab2881a406b9fd46224a3e8253bbc0141b4f844)
Signed-off-by: Simon Horman <>
drivers/usb/host/xhci-ring.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1992,6 +1992,9 @@ static int process_ctrl_td(struct xhci_h
td->urb->actual_length = requested - remaining;
goto finish_td;
+ case TRB_STATUS:
+ td->urb->actual_length = requested;
+ goto finish_td;
xhci_warn(xhci, "WARN: unexpected TRB Type %d\n",