From 29e81501c561a315e2eb6f9201630ceb9633b2b0 Mon Sep 17 00:00:00 2001 From: Xiaoguang Wu Date: Wed, 7 Nov 2018 14:35:41 +0800 Subject: [PATCH] DM USB: xHCI: refine error handling logic for ctrl transfer Under current implementation, when USB control transfer failed with Endpoint Stall error, there is no response reporting to UOS. This logic will result of timeout in UOS kernel and hence a longer enumeration process. This patch reports the Stall Error to UOS by xHCI Completion Event, which will fix this issue. Tracked-On: #1895 Signed-off-by: Xiaoguang Wu Reviewed-by: Liang Yang Acked-by: Yu Wang --- devicemodel/hw/pci/xhci.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devicemodel/hw/pci/xhci.c b/devicemodel/hw/pci/xhci.c index efdc632ed..bcd990cea 100644 --- a/devicemodel/hw/pci/xhci.c +++ b/devicemodel/hw/pci/xhci.c @@ -2862,8 +2862,9 @@ retry: } err = USB_TO_XHCI_ERR(err); - if ((err == XHCI_TRB_ERROR_SUCCESS) || - (err == XHCI_TRB_ERROR_SHORT_PKT)) { + if (err == XHCI_TRB_ERROR_SUCCESS || + err == XHCI_TRB_ERROR_SHORT_PKT || + err == XHCI_TRB_ERROR_STALL) { err = pci_xhci_xfer_complete(xdev, xfer, slot, epid, &do_intr); if (err != XHCI_TRB_ERROR_SUCCESS) do_retry = 0;