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


Groups > linux.kernel > #1579667

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

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] driver core: emit uevents when device is bound to a driver
Date 2017-02-13 13:10 +0100
Message-ID <tanC9-3wl-17@gated-at.bofh.it> (permalink)
References <tacQp-4I2-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Feb 12, 2017 at 04:36:18PM -0800, Dmitry Torokhov wrote:
> Majority of standard for a subsystem device attributes are created at the
> same time devices are created, before KOBJECT_ADD uevent is emitted by the
> driver core. This means that attributes are there when userspace is
> notified about new device appearance.
> 
> However many drivers create additional driver-specific device attributes
> when binding to the device, to provide userspace with additional controls,
> and such attributes may not be there yet when userpsace receives
> KOBJECT_ADD event.

How about we fix those drivers instead?

Are you going to change userspace (i.e. libudev) to refresh with this
new kobject uevent type?

The 'groups' field for drivers should handle this, but yes, there are
some subsystems that don't really do it, and there are drivers that like
to add random sysfs files to their device's directories which I would
argue is the correct solution here, but you don't like this, because you
say:

> Changing the drivers to introduce intermediate "dummy" device as a
> container for such attributes would be wasteful, and in many cases,
> braking our sysfs ABI.

I'd argue that you are adding random sysfs files to random device types
(i.e. a PCI device gets a random set of sysfs files just depending on
what driver bound to it.)  And that's wrong, and is why classes were
created.

Is there a specific type of devices that you have that you wish to fix
up using this new uevent type?

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] driver core: emit uevents when device is bound to a driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-13 01:40 +0100
  [PATCH 2/2] sysfs: add devm_sysfs_create_group() and friends Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-13 01:40 +0100
  Re: [PATCH 1/2] driver core: emit uevents when device is bound to a  driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-13 13:10 +0100
    Re: [PATCH 1/2] driver core: emit uevents when device is bound to a  driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-13 19:50 +0100
      Re: [PATCH 1/2] driver core: emit uevents when device is bound to a  driver Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-14 02:00 +0100
        Re: [PATCH 1/2] driver core: emit uevents when device is bound to a  driver Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2017-02-14 05:30 +0100

csiph-web