All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Alan Stern <stern@rowland.harvard.edu>, Oliver Neukum <oneukum@suse.com>
Cc: "Bjørn Mork" <bjorn@mork.no>, "USB list" <linux-usb@vger.kernel.org>
Subject: Re: correctly handling EPROTO
Date: Thu, 12 Mar 2026 16:57:18 +0100	[thread overview]
Message-ID: <64dc9c5d-d662-41e3-898f-71587b940a2c@suse.com> (raw)
In-Reply-To: <4f85311c-bdfe-46a4-a310-4a74a3c56b3e@rowland.harvard.edu>

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

On 12.03.26 15:21, Alan Stern wrote:
  
> There's a discussion about the same issue here:
> 
> 	https://bugzilla.kernel.org/show_bug.cgi?id=221184
> 
> See especially the later parts, starting with comment #28.

Well, that is fascinating, but not necessarily in a comfortable
way. It seems to me that for all drivers to care about the
exact details of getting which toggle back into sync is not
a viable strategy. This I'd say, when in doubt, clear a halt.

	Regards
		Oliver

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

From fc7a673c780e8eaf08a529938e70ad00a9edd7b3 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

Under some conditions -EPROTO requires a halt to be cleared.
This is too complicated to get optimal. We should not even
try. Hence the sane strategy is to clear a halt on
-EPROTO and directly retry for everything but a known
disconnect.

Signed-off-by: Oliver Neukum <oneukum@suse.com>

eproto
---
 drivers/usb/class/cdc-wdm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
index 9185295f5376..cfb31a8145ff 100644
--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -265,13 +265,14 @@ static void wdm_int_callback(struct urb *urb)
 		case -ECONNRESET:
 			return; /* unplug */
 		case -EPIPE:
+		case -EPROTO:
 			set_bit(WDM_INT_STALL, &desc->flags);
 			dev_err(&desc->intf->dev, "Stall on int endpoint\n");
 			goto sw; /* halt is cleared in work */
 		default:
 			dev_err_ratelimited(&desc->intf->dev,
 				"nonzero urb status received: %d\n", status);
-			break;
+			goto exit;
 		}
 	}
 
-- 
2.53.0


  reply	other threads:[~2026-03-12 15:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-12 13:55 correctly handling EPROTO Oliver Neukum
2026-03-12 14:21 ` Alan Stern
2026-03-12 15:57   ` Oliver Neukum [this message]
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-30  1:32                                                         ` Alan Stern
2026-03-30 12:36                                                           ` Michal Pecio
2026-04-01 21:50                                                             ` Michal Pecio
2026-04-02  2:20                                                               ` Alan Stern
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64dc9c5d-d662-41e3-898f-71587b940a2c@suse.com \
    --to=oneukum@suse.com \
    --cc=bjorn@mork.no \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.