Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1742306 > unrolled thread

Re: [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver

Started byDan Williams <dan.j.williams@intel.com>
First post2017-09-29 21:40 +0200
Last post2017-09-30 10:20 +0200
Articles 4 — 4 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v2 1/7] driver core: emit uevents when device is bound to  a driver Dan Williams <dan.j.williams@intel.com> - 2017-09-29 21:40 +0200
    RE: [PATCH v2 1/7] driver core: emit uevents when device is bound  to a driver "Ruhl, Michael J" <michael.j.ruhl@intel.com> - 2017-09-29 21:50 +0200
      Re: [PATCH v2 1/7] driver core: emit uevents when device is bound to  a driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-09-30 01:30 +0200
        Re: [PATCH v2 1/7] driver core: emit uevents when device is bound to  a driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-09-30 10:20 +0200

#1742306 — Re: [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver

FromDan Williams <dan.j.williams@intel.com>
Date2017-09-29 21:40 +0200
SubjectRe: [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver
Message-ID<uv9iF-20d-5@gated-at.bofh.it>
On Wed, Jul 19, 2017 at 5:24 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> There are certain touch controllers that may come up in either normal
> (application) or boot mode, depending on whether firmware/configuration is
> corrupted when they are powered on. In boot mode the kernel does not create
> input device instance (because it does not necessarily know the
> characteristics of the input device in question).
>
> Another number of controllers does not store firmware in a non-volatile
> memory, and they similarly need to have firmware loaded before input device
> instance is created. There are also other types of devices with similar
> behavior.
>
> There is a desire to be able to trigger firmware loading via udev, but it
> has to happen only when driver is bound to a physical device (i2c or spi).
> These udev actions can not use ADD events, as those happen too early, so we
> are introducing BIND and UNBIND events that are emitted at the right
> moment.
>
> Also, many drivers create additional driver-specific device attributes
> when binding to the device, to provide userspace with additional controls.
> The new events allow userspace to adjust these driver-specific attributes
> without worrying that they are not there yet.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Hi Dmitry,

Mike (cc'd) reports a regression with this change:

---

Previously, if I did:

# rmmod hfi1

The driver would be removed.

With 4.14.0-rc2+, when I remove the driver, the PCI bus is
automatically re-probed and the driver re-loaded.

---

A bisect points to commit 1455cf8dbfd0 "driver core: emit uevents when
device is bound to a driver". I'm sending this because I have this
mail in my archive, but I'll let Mike follow up with any other
details.

[toc] | [next] | [standalone]


#1742308 — RE: [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver

From"Ruhl, Michael J" <michael.j.ruhl@intel.com>
Date2017-09-29 21:50 +0200
SubjectRE: [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver
Message-ID<uv9sl-243-3@gated-at.bofh.it>
In reply to#1742306
> -----Original Message-----
> From: dan.j.williams@gmail.com [mailto:dan.j.williams@gmail.com] On
> Behalf Of Dan Williams
> Sent: Friday, September 29, 2017 3:37 PM
> To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Tejun Heo
> <htejun@gmail.com>; Linux Kernel Mailing List <linux-
> kernel@vger.kernel.org>; Guenter Roeck <linux@roeck-us.net>; Ruhl,
> Michael J <michael.j.ruhl@intel.com>
> Subject: Re: [PATCH v2 1/7] driver core: emit uevents when device is bound
> to a driver
> 
> On Wed, Jul 19, 2017 at 5:24 PM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > There are certain touch controllers that may come up in either normal
> > (application) or boot mode, depending on whether firmware/configuration
> is
> > corrupted when they are powered on. In boot mode the kernel does not
> create
> > input device instance (because it does not necessarily know the
> > characteristics of the input device in question).
> >
> > Another number of controllers does not store firmware in a non-volatile
> > memory, and they similarly need to have firmware loaded before input
> device
> > instance is created. There are also other types of devices with similar
> > behavior.
> >
> > There is a desire to be able to trigger firmware loading via udev, but it
> > has to happen only when driver is bound to a physical device (i2c or spi).
> > These udev actions can not use ADD events, as those happen too early, so
> we
> > are introducing BIND and UNBIND events that are emitted at the right
> > moment.
> >
> > Also, many drivers create additional driver-specific device attributes
> > when binding to the device, to provide userspace with additional controls.
> > The new events allow userspace to adjust these driver-specific attributes
> > without worrying that they are not there yet.
> >
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Hi Dmitry,
> 
> Mike (cc'd) reports a regression with this change:
> 
> ---
> 
> Previously, if I did:
> 
> # rmmod hfi1
> 
> The driver would be removed.
> 
> With 4.14.0-rc2+, when I remove the driver, the PCI bus is
> automatically re-probed and the driver re-loaded.
> 
> ---
> 
> A bisect points to commit 1455cf8dbfd0 "driver core: emit uevents when
> device is bound to a driver". I'm sending this because I have this
> mail in my archive, but I'll let Mike follow up with any other
> details.

My test environment is RedHat 7.3 GA + 4.14.0-rc2 kernel.

Blacklisting the driver keeps it from being autoloaded, but this didn't seem correct.

With the 4.13.x branch this did not occur

Thanks,

Mike



[toc] | [prev] | [next] | [standalone]


#1742396

FromDmitry Torokhov <dmitry.torokhov@gmail.com>
Date2017-09-30 01:30 +0200
Message-ID<uvcTg-4nD-7@gated-at.bofh.it>
In reply to#1742308
On Fri, Sep 29, 2017 at 07:40:15PM +0000, Ruhl, Michael J wrote:
> > -----Original Message-----
> > From: dan.j.williams@gmail.com [mailto:dan.j.williams@gmail.com] On
> > Behalf Of Dan Williams
> > Sent: Friday, September 29, 2017 3:37 PM
> > To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Tejun Heo
> > <htejun@gmail.com>; Linux Kernel Mailing List <linux-
> > kernel@vger.kernel.org>; Guenter Roeck <linux@roeck-us.net>; Ruhl,
> > Michael J <michael.j.ruhl@intel.com>
> > Subject: Re: [PATCH v2 1/7] driver core: emit uevents when device is bound
> > to a driver
> > 
> > On Wed, Jul 19, 2017 at 5:24 PM, Dmitry Torokhov
> > <dmitry.torokhov@gmail.com> wrote:
> > > There are certain touch controllers that may come up in either normal
> > > (application) or boot mode, depending on whether firmware/configuration
> > is
> > > corrupted when they are powered on. In boot mode the kernel does not
> > create
> > > input device instance (because it does not necessarily know the
> > > characteristics of the input device in question).
> > >
> > > Another number of controllers does not store firmware in a non-volatile
> > > memory, and they similarly need to have firmware loaded before input
> > device
> > > instance is created. There are also other types of devices with similar
> > > behavior.
> > >
> > > There is a desire to be able to trigger firmware loading via udev, but it
> > > has to happen only when driver is bound to a physical device (i2c or spi).
> > > These udev actions can not use ADD events, as those happen too early, so
> > we
> > > are introducing BIND and UNBIND events that are emitted at the right
> > > moment.
> > >
> > > Also, many drivers create additional driver-specific device attributes
> > > when binding to the device, to provide userspace with additional controls.
> > > The new events allow userspace to adjust these driver-specific attributes
> > > without worrying that they are not there yet.
> > >
> > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > 
> > Hi Dmitry,
> > 
> > Mike (cc'd) reports a regression with this change:
> > 
> > ---
> > 
> > Previously, if I did:
> > 
> > # rmmod hfi1
> > 
> > The driver would be removed.
> > 
> > With 4.14.0-rc2+, when I remove the driver, the PCI bus is
> > automatically re-probed and the driver re-loaded.
> > 
> > ---
> > 
> > A bisect points to commit 1455cf8dbfd0 "driver core: emit uevents when
> > device is bound to a driver". I'm sending this because I have this
> > mail in my archive, but I'll let Mike follow up with any other
> > details.
> 
> My test environment is RedHat 7.3 GA + 4.14.0-rc2 kernel.
> 
> Blacklisting the driver keeps it from being autoloaded, but this didn't seem correct.
> 
> With the 4.13.x branch this did not occur

Yeah, udev is being stupid. Either change ACTION=="remove" to
ACTION!="add" in /lib/udev/rules.d/80-drivers.rules or pick this patch:

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-linus&id=6878e7de6af726de47f9f3bec649c3f49e786586

Thanks.

-- 
Dmitry

[toc] | [prev] | [next] | [standalone]


#1742562

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-09-30 10:20 +0200
Message-ID<uvlaa-1Al-13@gated-at.bofh.it>
In reply to#1742396
On Fri, Sep 29, 2017 at 04:23:20PM -0700, Dmitry Torokhov wrote:
> On Fri, Sep 29, 2017 at 07:40:15PM +0000, Ruhl, Michael J wrote:
> > > -----Original Message-----
> > > From: dan.j.williams@gmail.com [mailto:dan.j.williams@gmail.com] On
> > > Behalf Of Dan Williams
> > > Sent: Friday, September 29, 2017 3:37 PM
> > > To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>; Tejun Heo
> > > <htejun@gmail.com>; Linux Kernel Mailing List <linux-
> > > kernel@vger.kernel.org>; Guenter Roeck <linux@roeck-us.net>; Ruhl,
> > > Michael J <michael.j.ruhl@intel.com>
> > > Subject: Re: [PATCH v2 1/7] driver core: emit uevents when device is bound
> > > to a driver
> > > 
> > > On Wed, Jul 19, 2017 at 5:24 PM, Dmitry Torokhov
> > > <dmitry.torokhov@gmail.com> wrote:
> > > > There are certain touch controllers that may come up in either normal
> > > > (application) or boot mode, depending on whether firmware/configuration
> > > is
> > > > corrupted when they are powered on. In boot mode the kernel does not
> > > create
> > > > input device instance (because it does not necessarily know the
> > > > characteristics of the input device in question).
> > > >
> > > > Another number of controllers does not store firmware in a non-volatile
> > > > memory, and they similarly need to have firmware loaded before input
> > > device
> > > > instance is created. There are also other types of devices with similar
> > > > behavior.
> > > >
> > > > There is a desire to be able to trigger firmware loading via udev, but it
> > > > has to happen only when driver is bound to a physical device (i2c or spi).
> > > > These udev actions can not use ADD events, as those happen too early, so
> > > we
> > > > are introducing BIND and UNBIND events that are emitted at the right
> > > > moment.
> > > >
> > > > Also, many drivers create additional driver-specific device attributes
> > > > when binding to the device, to provide userspace with additional controls.
> > > > The new events allow userspace to adjust these driver-specific attributes
> > > > without worrying that they are not there yet.
> > > >
> > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > > 
> > > Hi Dmitry,
> > > 
> > > Mike (cc'd) reports a regression with this change:
> > > 
> > > ---
> > > 
> > > Previously, if I did:
> > > 
> > > # rmmod hfi1
> > > 
> > > The driver would be removed.
> > > 
> > > With 4.14.0-rc2+, when I remove the driver, the PCI bus is
> > > automatically re-probed and the driver re-loaded.
> > > 
> > > ---
> > > 
> > > A bisect points to commit 1455cf8dbfd0 "driver core: emit uevents when
> > > device is bound to a driver". I'm sending this because I have this
> > > mail in my archive, but I'll let Mike follow up with any other
> > > details.
> > 
> > My test environment is RedHat 7.3 GA + 4.14.0-rc2 kernel.
> > 
> > Blacklisting the driver keeps it from being autoloaded, but this didn't seem correct.
> > 
> > With the 4.13.x branch this did not occur
> 
> Yeah, udev is being stupid. Either change ACTION=="remove" to
> ACTION!="add" in /lib/udev/rules.d/80-drivers.rules or pick this patch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-linus&id=6878e7de6af726de47f9f3bec649c3f49e786586

I have this fix queued up for Linus, sorry for the delay in getting it
to him, hope to do that today...

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web