All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bastien Nocera <hadess@hadess.net>
To: "M. Vefa Bicakci" <m.v.b@runbox.com>, linux-usb@vger.kernel.org
Cc: Andrey Konovalov <andreyknvl@google.com>,
	stable@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	syzkaller@googlegroups.com
Subject: Re: [PATCH 1/2] usbcore/driver: Fix specific driver selection
Date: Thu, 17 Sep 2020 12:49:46 +0200	[thread overview]
Message-ID: <a6e14983a8849d5f75a43f403c7cc721b6e4a420.camel@hadess.net> (raw)
In-Reply-To: <0ce9fcb5-8684-cf5c-e8ad-02217848cbe7@runbox.com>

On Thu, 2020-09-17 at 13:39 +0300, M. Vefa Bicakci wrote:
> On 17/09/2020 13.23, Bastien Nocera wrote:
> > On Thu, 2020-09-17 at 12:59 +0300, M. Vefa Bicakci wrote:
> > > This commit resolves two minor bugs in the selection/discovery of
> > > more
> > > specific USB device drivers for devices that are currently bound
> > > to
> > > generic USB device drivers.
> > > 
> > > The first bug is related to the way a candidate USB device driver
> > > is
> > > compared against the generic USB device driver. The code in
> > > is_dev_usb_generic_driver() used to unconditionally use
> > > to_usb_device_driver() on each device driver, without verifying
> > > that
> > > the device driver in question is a USB device driver (as opposed
> > > to a
> > > USB interface driver).
> > 
> > You could also return early if is_usb_device() fails in
> > __usb_bus_reprobe_drivers(). Each of the interface and the device
> > itself is a separate "struct device", and "non-interface" devices
> > won't
> > have interface devices assigned to them.
> 
> Will do! If I understand you correctly, you mean something like the
> following:
> 
> static int __usb_bus_reprobe_drivers(struct device *dev, void *data)
> {
>          struct usb_device_driver *new_udriver = data;
>          struct usb_device *udev;
>          int ret;
> 
> 	/* Proposed addition begins */
> 
> 	if (!is_usb_device(dev))
> 		return 0;
> 
> 	/* Proposed addition ends */
> 
>          if (!is_dev_usb_generic_driver(dev))
>                  return 0;

Or:
	if (!is_usb_device(dev) ||
            !is_dev_usb_generic_driver(dev))
 		return 0;



  reply	other threads:[~2020-09-17 10:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16 13:33 USB driver ID matching broken Andrey Konovalov
2020-09-16 14:15 ` Greg Kroah-Hartman
2020-09-16 14:39   ` Bastien Nocera
2020-09-16 15:58     ` M. Vefa Bicakci
2020-09-17  9:59       ` [PATCH 1/2] usbcore/driver: Fix specific driver selection M. Vefa Bicakci
2020-09-17  9:59         ` [PATCH 2/2] usbip: Make the driver's match function specific M. Vefa Bicakci
2020-09-17 10:23         ` [PATCH 1/2] usbcore/driver: Fix specific driver selection Bastien Nocera
2020-09-17 10:39           ` M. Vefa Bicakci
2020-09-17 10:49             ` Bastien Nocera [this message]
2020-09-17 14:41               ` [PATCH 1/3] " M. Vefa Bicakci
2020-09-17 14:41                 ` [PATCH 2/3] usbcore/driver: Fix incorrect downcast M. Vefa Bicakci
2020-09-17 15:01                   ` Alan Stern
2020-09-18  9:26                     ` M. Vefa Bicakci
2020-09-17 14:41                 ` [PATCH 3/3] usbip: Make the driver's match function specific M. Vefa Bicakci
2020-09-17 15:21                   ` Shuah Khan
2020-09-18  9:26                     ` M. Vefa Bicakci
2020-09-18 14:31                       ` M. Vefa Bicakci
2020-09-18 15:49                         ` Shuah Khan
2020-09-19 13:54                           ` M. Vefa Bicakci
2020-09-21 17:03                             ` M. Vefa Bicakci
2020-09-18 14:31                 ` [PATCH 1/3] usbcore/driver: Fix specific driver selection M. Vefa Bicakci
2020-09-18 14:52                   ` Alan Stern
2020-09-19 13:52                     ` M. Vefa Bicakci

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=a6e14983a8849d5f75a43f403c7cc721b6e4a420.camel@hadess.net \
    --to=hadess@hadess.net \
    --cc=andreyknvl@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=m.v.b@runbox.com \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=syzkaller@googlegroups.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 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.