Linux USB
 help / color / mirror / Atom feed
From: Alan Stern <stern@rowland.harvard.edu>
To: Bastien Nocera <hadess@hadess.net>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	USB <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v4] USB: Fix device driver race
Date: Fri, 24 Jul 2020 13:08:14 -0400	[thread overview]
Message-ID: <20200724170814.GA1395815@rowland.harvard.edu> (raw)
In-Reply-To: <e46ee6070263cd6672a42050040dbe1503036702.camel@hadess.net>

On Fri, Jul 24, 2020 at 06:52:31PM +0200, Bastien Nocera wrote:
> On Fri, 2020-07-24 at 11:27 -0400, Alan Stern wrote:

> > > > +               if (new_udriver->match || new_udriver->id_table)
> > > 
> > > But match check is incorporated in the loop function.
> > 
> > Agreed, this test is redundant.  However, we should test that 
> > new_udriver != &usb_generic_driver.
> 
> Do you really want to loop over every USB device when you know for a
> fact that not a single one will match?

Think of it the other way around: How often will anybody load a 
specialized USB device driver that doesn't have a match function or ID 
table?  It wouldn't match any devices!

> I guess it's unlikely, the generic driver would be loaded before any
> device,

Since it's built into usbcore, I guess that's true.

>  and the specialised drivers need to be able to selected, so
> I've done that locally.

Okay, you're ready to submit the next version?

Alan Stern

  reply	other threads:[~2020-07-24 17:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24  8:59 [PATCH v4] USB: Fix device driver race Bastien Nocera
2020-07-24 10:18 ` Sergei Shtylyov
2020-07-24 15:16   ` Bastien Nocera
2020-07-24 10:32 ` Andy Shevchenko
2020-07-24 10:39   ` Andy Shevchenko
2020-07-24 15:19     ` Bastien Nocera
2020-07-24 15:19   ` Bastien Nocera
2020-07-24 15:27   ` Alan Stern
2020-07-24 16:52     ` Bastien Nocera
2020-07-24 17:08       ` Alan Stern [this message]
2020-07-24 17:14         ` Bastien Nocera
2020-07-25  9:17           ` Bastien Nocera
2020-07-24 20:05     ` Andy Shevchenko

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=20200724170814.GA1395815@rowland.harvard.edu \
    --to=stern@rowland.harvard.edu \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hadess@hadess.net \
    --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