From 02f249949eb3525afe16cc46252b07a1ef9ccae1 Mon Sep 17 00:00:00 2001 From: Pradeep Das Date: Fri, 2 Mar 2018 10:03:19 +0530 Subject: [PATCH] USB: xHCI: Fixed abort_td failure for usb start command With specific USB storage device, usb start command causing system reboot. This change avoids queuing any new URB on a halted endpoint. The failure log is given below: ------------------------ ERROR MESSAGE --------------------------- scanning bus 1 for devices... WARN halted endpoint, queueing URB anyway. Unexpected XHCI event TRB, skipping... (87244c70 00000000 13000000 01008401) BUG: failure at drivers/usb/host/xhci-ring.c:489/abort_td()! BUG! ------------------------------------------------------------------ Change-Id: I0735b89832416ebd4b8d80129572afec4bb950a4 Signed-off-by: Pradeep Das --- drivers/usb/host/xhci-ring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 5a1391fbe3..318eae886d 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -225,7 +225,8 @@ static int prepare_ring(struct xhci_ctrl *ctrl, struct xhci_ring *ep_ring, puts("WARN waiting for error on ep to be cleared\n"); return -EINVAL; case EP_STATE_HALTED: - puts("WARN halted endpoint, queueing URB anyway.\n"); + puts("WARN halted endpoint\n"); + return -EPIPE; case EP_STATE_STOPPED: case EP_STATE_RUNNING: debug("EP STATE RUNNING.\n");