diff mbox series

[v2,6/8] usb: xhci: Do not panic on event timeouts

Message ID 20231029-usb-fixes-1-v2-6-623533f6316e@marcan.st
State Accepted
Commit 2fd7037122a920ae22377b06aa5b32651cc71f13
Delegated to: Bin Meng
Headers show
Series USB fixes: xHCI error handling | expand

Commit Message

Hector Martin Oct. 29, 2023, 6:37 a.m. UTC
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 <marcan@marcan.st>
---
 drivers/usb/host/xhci-ring.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Marek Vasut Oct. 29, 2023, 2:35 p.m. UTC | #1
On 10/29/23 07:37, Hector Martin wrote:
> 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 <marcan@marcan.st>
> ---
>   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 a969eafdc8ee..ae0ab5744df0 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -494,8 +494,9 @@ union xhci_trb *xhci_wait_for_event(struct xhci_ctrl *ctrl, trb_type expected)
>   	if (expected == TRB_TRANSFER)
>   		return NULL;
>   
> -	printf("XHCI timeout on event type %d... cannot recover.\n", expected);
> -	BUG();
> +	printf("XHCI timeout on event type %d...\n", expected);
> +
> +	return NULL;

Reviewed-by: Marek Vasut <marex@denx.de>
diff mbox series

Patch

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index a969eafdc8ee..ae0ab5744df0 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -494,8 +494,9 @@  union xhci_trb *xhci_wait_for_event(struct xhci_ctrl *ctrl, trb_type expected)
 	if (expected == TRB_TRANSFER)
 		return NULL;
 
-	printf("XHCI timeout on event type %d... cannot recover.\n", expected);
-	BUG();
+	printf("XHCI timeout on event type %d...\n", expected);
+
+	return NULL;
 }
 
 /*