This ports U-Boot commit 2fd7037122a920ae22377b06aa5b32651cc71f13:

| Author:     Hector Martin <[email protected]>
| AuthorDate: Sun Oct 29 15:37:43 2023 +0900
|
| usb: xhci: Do not panic on event timeouts
|
| Now that we always check the return value, just return NULL on timeouts.
| We can still log the error since this is a problem, but it's not reason
| to panic.
|
| Signed-off-by: Hector Martin <[email protected]>

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/usb/host/xhci-ring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 6a859dbbfac9..5f68bc7c2f35 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -497,8 +497,9 @@ union xhci_trb *xhci_wait_for_event(struct xhci_ctrl *ctrl, 
trb_type expected,
        if (expected == TRB_TRANSFER)
                return NULL;
 
-       dev_err(ctrl->dev, "XHCI timeout on event type %d... cannot 
recover.\n", expected);
-       BUG();
+       dev_warn(ctrl->dev, "XHCI timeout on event type %d...\n", expected);
+
+       return NULL;
 }
 
 /*
-- 
2.39.2


Reply via email to