linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Jonas Karlsson <jonas.karlsson@actia.se>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: USB transaction errors causing RCU stalls and kernel panics
Date: Wed, 04 Mar 2020 11:29:11 +0100	[thread overview]
Message-ID: <1583317751.12738.22.camel@suse.com> (raw)
In-Reply-To: <ca6f029a57f24ee9aea39385a9ad55bd@actia.se>

Am Dienstag, den 03.03.2020, 20:08 +0000 schrieb Jonas Karlsson:

Hi,

> > > If I pull the reset pin of the USB hub and keep it in reset state at
> > > this point, the event loop of failing transfers continues despite
> > > there is nothing on the USB bus any longer. The only way to get out of that

Well, if nothing is on the bus, CDC-ACM's disconnect() should be
called. Is the HC so broken, that even that does not work?

> > loop is to either unbind the usb driver or power cycle the board.
> > > 
> > > Is this the expected behavior when USB transaction error happens for all
> > 
> > transfers when using cdc-acm class driver?

Well, it will happen on a lot of drivers. Generally the higher level
drivers are written under the assumption that you can submit URBs as
often as you want.

> The reason I posted on this mailing list was that I was afraid that the cdc-acm driver could
> be causing new transfers to be started when the previous fails due to USB transaction errors and
> then trigger this event storm.

It does. However it does so in a way that the lower layers
should survive. You may argue that cdc_acm should do error handling.
The question is which handling. If a reset does not help as you
said, I do not see what cdc_acm can do.

> The acm_ctrl_irq() function seems to submit a new urb directly if the previous fails, but I cannot

Yes. There is no error handling in the CDC specification.
Unless you want to reset the whole device you are stuck.
The device is free to respond with a control message any time
it wants. You need to keep that URB running if you want the
device to remain fully functional.

> say that I understand that code very well yet. The acm_read_bulk_callback() function also seem
> to submit a new read urb on USB transaction Errors. But If you think this could not cause this
> behavior I will ask our supplier to fix the cdns driver.

This has the same issue as the irq endpoint. We need to keep the data
pump running while the device is operational.

	Regards
		Oliver


  parent reply	other threads:[~2020-03-04 10:29 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-03 15:05 USB transaction errors causing RCU stalls and kernel panics Jonas Karlsson
2020-03-03 16:39 ` Greg KH
2020-03-03 20:08   ` Jonas Karlsson
2020-03-04  6:37     ` Greg KH
2020-03-04 10:29     ` Oliver Neukum [this message]
2020-03-04 12:11     ` Mathias Nyman
2020-03-04 14:12       ` Oliver Neukum
2020-03-04 16:21         ` Mathias Nyman
2020-03-06  1:31           ` Peter Chen
2020-03-09 14:21             ` Jonas Karlsson
2020-03-10  8:14               ` Peter Chen
2020-03-10 10:04                 ` Jonas Karlsson
2020-03-10 11:04                   ` Oliver Neukum
2020-03-10 11:21                     ` Oliver Neukum
2020-03-10 12:26                       ` Jonas Karlsson
2020-03-10 16:04                         ` Jonas Karlsson
2020-03-10 16:11                           ` Fabio Estevam
2020-03-11  6:25                             ` Jonas Karlsson
2020-03-11 10:28                               ` Oliver Neukum
2020-03-11 14:59                                 ` Jonas Karlsson
2020-03-12 13:45                                   ` Oliver Neukum
2020-03-12 15:37                                     ` Jonas Karlsson
2020-03-13  9:27                                       ` Oliver Neukum
2020-03-16  7:07                                     ` Jonas Karlsson
2020-03-23 11:37                                       ` Jonas Karlsson

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=1583317751.12738.22.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonas.karlsson@actia.se \
    --cc=linux-usb@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).