public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-kernel@vger.kernel.org, Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH 1/2] driver core: emit uevents when device is bound to a driver
Date: Mon, 13 Feb 2017 04:07:01 -0800	[thread overview]
Message-ID: <20170213120701.GB25852@kroah.com> (raw)
In-Reply-To: <20170213003619.4083-1-dmitry.torokhov@gmail.com>

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

  parent reply	other threads:[~2017-02-13 12:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13  0:36 [PATCH 1/2] driver core: emit uevents when device is bound to a driver Dmitry Torokhov
2017-02-13  0:36 ` [PATCH 2/2] sysfs: add devm_sysfs_create_group() and friends Dmitry Torokhov
2017-03-27 17:53   ` Dmitry Torokhov
2017-03-27 19:35     ` Greg Kroah-Hartman
2017-06-07 17:04       ` Dmitry Torokhov
2017-06-17 19:27         ` Greg Kroah-Hartman
2017-02-13 12:07 ` Greg Kroah-Hartman [this message]
2017-02-13 18:46   ` [PATCH 1/2] driver core: emit uevents when device is bound to a driver Dmitry Torokhov
2017-02-14  0:52     ` Greg Kroah-Hartman
2017-02-14  4:22       ` Dmitry Torokhov
  -- strict thread matches above, loose matches on Subject: below --
2017-07-18 19:30 [PATCH 0/2] New bind/unbingd uevents Dmitry Torokhov
2017-07-18 19:30 ` [PATCH 1/2] driver core: emit uevents when device is bound to a driver Dmitry Torokhov

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=20170213120701.GB25852@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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