[PATCH 4.19 010/110] xhci: Add check for invalid byte size error when UAS devices are connected.

From: Greg Kroah-Hartman
Date: Thu Nov 29 2018 - 09:28:35 EST

4.19-stable review patch. If anyone has any objections, please let me know.


From: Sandeep Singh <sandeep.singh@xxxxxxx>

commit d9193efba84fe4c4aa22a569fade5e6ca971f8af upstream.

Observed "TRB completion code (27)" error which corresponds to Stopped -
Length Invalid error(xhci spec section 4.17.4) while connecting USB to
SATA bridge.

Looks like this case was not considered when the following patch[1] was
committed. Hence adding this new check which can prevent
the invalid byte size error.

[1] ade2e3a xhci: handle transfer events without TRB pointer

Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Sandeep Singh <sandeep.singh@xxxxxxx>
cc: Nehal Shah <Nehal-bakulchandra.Shah@xxxxxxx>
cc: Shyam Sundar S K <Shyam-sundar.S-k@xxxxxxx>
Signed-off-by: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

drivers/usb/host/xhci-ring.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2254,6 +2254,7 @@ static int handle_tx_event(struct xhci_h
goto cleanup;
goto cleanup;
xhci_err(xhci, "ERROR Transfer event for unknown stream ring slot %u ep %u\n",