cdc_wdm driver: infinite loop on -EPROTO error leads to system freeze with SIM7600 module (Issue #6746)
A message that is not in the archive (sent off-list or not yet received): raspberrypi/linux/issues/[email protected]
A message that is not in the archive (sent off-list or not yet received): raspberrypi/linux/issues/6746/[email protected]
[+Oliver, linux-usb]
Quoted 9 lines · sfczsolti
sfczsolti left a comment (raspberrypi/linux#6746)
Hi there,
I opened this issue a few weeks ago regarding
cdc_wdmdriver and haven’t received any feedback yet. I wanted to follow up to see if anyone has had a chance to review it or if there is any update on addressing the problem.If there’s any further information you need from me, or if there’s anything I can do to help, please let me know.
Thank you for your time and effort!
Many USB drivers getting a -EPROTO error immediately give up and treat it as fatal (an indication of a disconnection).
However, I'm not an expert on the cdc-wdm driver, and the people who are may not want to do this.
Alan Stern
Quoted 7 lines · Alan Stern
[+Oliver, linux-usb]
Quoted 4 lines · sfczsolti
sfczsolti left a comment (raspberrypi/linux#6746)
Hi there,
Quoted 8 lines
Quoted 5 lines
I opened this issue a few weeks ago regarding
cdc_wdmdriver and haven’t received any feedback yet. I wanted to follow up to see if anyone has had a chance to review it or if there is any update on addressing the problem.If there’s any further information you need from me, or if there’s anything I can do to help, please let me know.
Thank you for your time and effort!
Many USB drivers getting a
-EPROTOerror immediately give up and treat it as fatal (an indication of a disconnection).
Hi,
that is indeed the simplest option.
In the medium term this driver's error handling needs some love. Dear sfczsolti, could you test the attached patch?
From 5586a09bb533d887221b77b5b40787093caf6c45 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <[email protected]>
Date: Mon, 14 Apr 2025 17:44:21 +0200
Subject: [PATCH] usb: wdm: give up upon EPROTO
If we are getting -EPROTO in a completion handler the likely cause is disconnection. Hence we should give up. The alterative is livelock.
--- drivers/usb/class/cdc-wdm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/class/cdc-wdm.c +3 -0
@@ -269,6 +269,9 @@ static void wdm_int_callback(struct urb *urb)set_bit (WDM_INT_STALL , &desc->flags);dev_err (&desc->intf->dev,"Stall on int endpoint\n" ); goto sw;/* halt is cleared in work */ +case -EPROTO : +/* we are being disconnected */ +return ;default :dev_err_ratelimited (&desc->intf->dev,"nonzero urb status received: %d\n" , status);
Signature · 1 line
2.49.0