public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* correctly handling EPROTO
@ 2026-03-12 13:55 Oliver Neukum
  2026-03-12 14:21 ` Alan Stern
  0 siblings, 1 reply; 42+ messages in thread
From: Oliver Neukum @ 2026-03-12 13:55 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: Alan Stern, USB list

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]

Hi,

as we just discussed an HID device which tends to report
-EPROTO from time to time, the question what a driver is
to do when it gets -EPROTO.
Do we just retry? I am not really happy with that, as we
may very well get into a livelock. Nevertheless I think
we cannot just assume that -EPROTO is not recoverable.

Do we need to do something drastic like generalizing
the backoff logic from usbhid?

What do you think?

	Regards
		Oliver

[-- Attachment #2: 0001-usb-class-cdc-wdm-handle-EPROTO-on-interrupt-endpoin.patch --]
[-- Type: text/x-patch, Size: 1021 bytes --]

From c5656d49224908d03a4f7dc82353e919df5198e4 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@suse.com>
Date: Thu, 12 Mar 2026 12:29:23 +0100
Subject: [PATCH] usb: class: cdc-wdm handle EPROTO on interrupt endpoint

If we get an unexpected error, most likely EPROTO
during disconnect, there is no point in checking
for transmitted data. We do not want to process
such messages, even if they are long enough.
As we consider such events recoverable, jump
directly to resubmission.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/usb/class/cdc-wdm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 9185295f5376..8067506d06a4 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -271,7 +271,7 @@ static void wdm_int_callback(struct urb *urb)
 		default:
 			dev_err_ratelimited(&desc->intf->dev,
 				"nonzero urb status received: %d\n", status);
-			break;
+			goto exit;
 		}
 	}
 
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2026-03-29 16:46 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-12 13:55 correctly handling EPROTO Oliver Neukum
2026-03-12 14:21 ` Alan Stern
2026-03-12 15:57   ` Oliver Neukum
2026-03-13  7:53     ` Michal Pecio
2026-03-13 10:33       ` Oliver Neukum
2026-03-13 15:28         ` Alan Stern
2026-03-13 22:45           ` Thinh Nguyen
2026-03-14  2:39             ` Alan Stern
2026-03-16 12:58               ` Oliver Neukum
2026-03-16 14:02                 ` Alan Stern
2026-03-16 14:47                   ` Oliver Neukum
2026-03-16 17:33                     ` Alan Stern
2026-03-16 19:32                       ` Oliver Neukum
2026-03-17  9:05                         ` Mathias Nyman
2026-03-17 14:31                         ` Alan Stern
2026-03-17 16:20                           ` Oliver Neukum
2026-03-17 18:03                             ` Alan Stern
2026-03-18  9:54                               ` Oliver Neukum
2026-03-18 17:46                                 ` Alan Stern
2026-03-18 21:38                                   ` Michal Pecio
2026-03-18 23:59                                     ` Thinh Nguyen
2026-03-19  2:07                                       ` Alan Stern
2026-03-19 23:16                                         ` Thinh Nguyen
2026-03-20  9:58                                           ` Michal Pecio
2026-03-20 16:20                                           ` Alan Stern
2026-03-20 17:49                                             ` Oliver Neukum
2026-03-21  2:14                                             ` Thinh Nguyen
2026-03-21  5:54                                               ` Michal Pecio
2026-03-21 15:58                                                 ` Alan Stern
2026-03-28 21:22                                                   ` Michal Pecio
2026-03-29  1:52                                                     ` Alan Stern
2026-03-29 16:46                                                       ` Michal Pecio
2026-03-23 10:26                                               ` Oliver Neukum
2026-03-24  1:06                                                 ` Thinh Nguyen
2026-03-24  9:28                                                   ` Oliver Neukum
2026-03-24 13:25                                                     ` Alan Stern
2026-03-25  1:44                                                     ` Thinh Nguyen
2026-03-19  1:56                                     ` Alan Stern
2026-03-19  8:40                                       ` Mathias Nyman
2026-03-19 23:34                                         ` Thinh Nguyen
2026-03-19  8:55                                       ` Michal Pecio
2026-03-19 14:24                                         ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox