public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Oliver Neukum <oneukum@suse.com>
Cc: Jason-ch Chen <jason-ch.chen@mediatek.com>,
	Hayes Wang <hayeswang@realtek.com>,
	"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-mediatek@lists.infradead.org" 
	<linux-mediatek@lists.infradead.org>,
	"Project_Global_Chrome_Upstream_Group@mediatek.com" 
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	"hsinyi@google.com" <hsinyi@google.com>,
	nic_swsd <nic_swsd@realtek.com>
Subject: Re: [PATCH] r8152: stop submitting rx for -EPROTO
Date: Thu, 30 Sep 2021 11:18:19 -0400	[thread overview]
Message-ID: <20210930151819.GC464826@rowland.harvard.edu> (raw)
In-Reply-To: <274ec862-86cf-9d83-7ea7-5786e30ca4a7@suse.com>

On Thu, Sep 30, 2021 at 11:30:17AM +0200, Oliver Neukum wrote:
> 
> On 29.09.21 11:52, Jason-ch Chen wrote:
> > On Wed, 2021-09-29 at 08:14 +0000, Hayes Wang wrote:
> >>
> > Hi Hayes,
> >
> > Sometimes Rx submits rapidly and the USB kernel driver of opensource
> > cannot receive any disconnect event due to CPU heavy loading, which
> > finally causes a system crash.
> > Do you have any suggestions to modify the r8152 driver to prevent this
> > situation happened?
> >
> > Regards,
> > Jason
> >
> Hi,
> 
> Hayes proposed a solution. Basically you solve this the way HID or WDM do it
> delaying resubmission. This makes me wonder whether this problem is specific
> to any driver. If it is not, as I would argue, do we have a deficiency
> in our API?
> 
> Should we have something like: usb_submit_delayed_urb() ?

There has been some discussion about this in the past.

In general, -EPROTO is almost always a non-recoverable error.  In 
usually occurs when a USB cable has been unplugged, before the 
upstream hub has notified the kernel about the unplug event.  It also 
can occur when the device's firmware has crashed.

I do tend to think there is a deficiency in our API, and that it 
should be fixed by making the core logically disable an endpoint 
(clear the ep->enabled flag) whenever an URB for that endpoint 
completes with -EPROTO, -EILSEQ, or -ETIME status.  (In retrospect, 
using three distinct status codes for these errors was a mistake.)  
Then we wouldn't have to go through this piecemeal approach, 
modifying individual drivers to make them give up whenever they get 
one of these errors.

But then we'd have also have to make sure drivers have a way to 
logically re-enable endpoints, for the unlikely case that the error 
can be recovered from.  Certainly set-config, set-interface, and 
clear-halt should do this.  Anything else?

Alan Stern

  reply	other threads:[~2021-09-30 15:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29  5:18 [PATCH] r8152: stop submitting rx for -EPROTO Jason-ch Chen
2021-09-29  8:14 ` Hayes Wang
2021-09-29  9:52   ` Jason-ch Chen
2021-09-30  2:41     ` Hayes Wang
2021-10-01  1:36       ` Jason-ch Chen
2021-09-30  9:30     ` Oliver Neukum
2021-09-30 15:18       ` Alan Stern [this message]
2021-10-01  2:40         ` Hayes Wang
2021-10-01  3:26           ` Hayes Wang
2021-10-01 15:22             ` Alan Stern
2021-10-04  2:15               ` Hayes Wang
2021-10-04 11:44               ` Oliver Neukum
2021-10-04 14:33                 ` Alan Stern
2021-09-30 16:13       ` Hayes Wang
2021-10-04  6:28 ` [PATCH net] r8152: avoid to resubmit rx immediately Hayes Wang
2021-10-05 11:50   ` patchwork-bot+netdevbpf

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=20210930151819.GC464826@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=hayeswang@realtek.com \
    --cc=hsinyi@google.com \
    --cc=jason-ch.chen@mediatek.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=oneukum@suse.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox