All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Troels Liebe Bentsen <troels@connectedcars.dk>
Cc: linux-usb@vger.kernel.org
Subject: Re: All USB tools hang when one descriptor read fails and needs to timeout
Date: Thu, 26 Jan 2023 13:23:27 +0100	[thread overview]
Message-ID: <Y9Jwv1ColWNwH4+0@kroah.com> (raw)
In-Reply-To: <CAHHqYPMHBuPZqG9Rd9i+hN9Mq89pRn6M_0PLsyWkcK_hZr3xAA@mail.gmail.com>

On Thu, Jan 26, 2023 at 12:49:32PM +0100, Troels Liebe Bentsen wrote:
> Hi,
> 
> We have a hardware projekt where something is off with power ON
> timing. It sometimes gets started in a broken state where the device
> is seen by the USB system but does not respond to descriptor reads.

Ah, a broken USB device, not much the kernel can do about that :(

> When this happens this causes lsusb and libusb based tools to hang
> until the descriptor read in the USB subsystem timeout out after 30
> seconds or so. It looks like the tools are trying to read
> /sys/bus/usb/devices/.../descriptors and it blocks until the timeout
> happens.
> 
> We should fix our hardware and have done so in the next revision but
> why should one device be able to block the descriptors file that most
> user land USB code seem to use.

If the device does not respond, what is the kernel or userspace supposed
to do?

> Would there be any reasoning against just serving the descriptors file
> as it looked before inserting the broken USB device instead of
> blocking the read?

So a different device's descriptor file is being blocked by a broken
device?  Are you sure?  They should all be independent.

> And if we wanted to create a pull request for a change like that would
> it be accepted or would it be considered breaking the API?

It depends on what the kernel change looks like.  Have you tried
anything that worked for you that you wish to propose?

thanks,

greg k-h

  reply	other threads:[~2023-01-26 12:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 11:49 All USB tools hang when one descriptor read fails and needs to timeout Troels Liebe Bentsen
2023-01-26 12:23 ` Greg KH [this message]
2023-01-26 13:06   ` Troels Liebe Bentsen
2023-01-26 13:12     ` Greg KH
2023-01-26 13:59       ` Troels Liebe Bentsen
2023-01-26 14:27         ` Hans Petter Selasky
2023-01-26 15:26           ` Troels Liebe Bentsen
2023-01-26 16:23             ` Alan Stern
2023-01-26 16:17         ` Alan Stern
2023-01-27 14:12           ` Troels Liebe Bentsen
2023-01-27 16:07             ` Alan Stern
2023-01-31 15:59               ` Troels Liebe Bentsen
2023-01-31 20:41                 ` Alan Stern
2023-01-31 20:56                   ` Greg KH
2023-02-07  8:25                     ` Troels Liebe Bentsen
2023-02-07  8:33                       ` Troels Liebe Bentsen
2023-02-07 17:52                       ` Alan Stern
2023-02-08 16:48                         ` Alan Stern
2023-02-08 20:46                           ` Troels Liebe Bentsen
2023-02-08 21:57                             ` 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=Y9Jwv1ColWNwH4+0@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=troels@connectedcars.dk \
    /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.