mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
To: Greg KH <gregkh@suse.de>
Cc: Kay Sievers <kay.sievers@vrfy.org>, linux-kernel@vger.kernel.org
Subject: Re: [RFC] bind/unbind uevent
Date: Tue, 7 Dec 2010 18:29:37 +0100 (CET)	[thread overview]
Message-ID: <alpine.LFD.2.02.1012071814160.1998@localhost6.localdomain6> (raw)
In-Reply-To: <20101207162755.GA32328@suse.de>


On Tue, 7 Dec 2010, Greg KH wrote:
> On Tue, Dec 07, 2010 at 05:18:27PM +0100, Sebastian Ott wrote:
> > Hi,
> > 
> > There is currently no generic trigger for userspace to know when a driver
> > is bound to a device.
> 
> Not true at all, you get one when a device is attached to a bus.  What's
> wrong with that notification?
we get a KOBJ_ADD if a device is attached to a bus, but this does not
imply that a device driver is bound to this device

> 
> > Such a trigger may be required in cases where setup
> > steps must be performed in userspace after the device is bound, e.g.
> > because the driver adds sysfs attributes in its probe function.
> 
> A driver should not add sysfs attributes in its probe function as that
> is racy as you have noticed.  Add the attributes in the bus functions
> for that driver and it should be fine.
sry..I was not clear on this one. I was talking driver specific
attributes per device. So I'm searching for a trigger when these
attributes are created, or in other words when the device is useable,
which I think translates to when a driver is bound to this device.

> 
> > I can imagine 3 possible ways to solve this problem:
> > * add a bus specific change event (triggered by BUS_NOTIFY_BOUND_DRIVER)
> >   - this may result in duplicated code for each bus
> > * dissable autoprobing and "manually" probe the device from userspace
> >   triggered by the add event - this duplicates logic already implemented
> >   in the kernel
> > * add a generic bind/unbind uevent
> > 
> > Which one is preferred from a driver core perspective?
> 
> None, use the existing notifications like everyone else :)
> 
> thanks,
> 
> greg k-h
> 

  reply	other threads:[~2010-12-07 17:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 16:18 Sebastian Ott
2010-12-07 16:27 ` Greg KH
2010-12-07 17:29   ` Sebastian Ott [this message]
2010-12-07 18:33     ` Greg KH
2010-12-07 19:00       ` Kay Sievers
2010-12-08 10:18         ` Sebastian Ott
2010-12-08 16:02           ` Greg KH
2010-12-13 19:27             ` Sebastian Ott
2010-12-13 19:36               ` Greg KH
2010-12-14 18:26                 ` Sebastian Ott
2010-12-14 19:29                   ` Greg KH
2010-12-15 13:21                     ` Cornelia Huck
2010-12-15 16:23                       ` Greg KH
2010-12-15 17:35                         ` Cornelia Huck
2010-12-15 17:51                           ` Kay Sievers
2010-12-15 18:08                             ` Cornelia Huck
2010-12-15 18:18                               ` Greg KH
2010-12-16 10:22                                 ` Cornelia Huck
2010-12-08 10:16       ` Sebastian Ott
2010-12-08 16:01         ` Greg KH

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=alpine.LFD.2.02.1012071814160.1998@localhost6.localdomain6 \
    --to=sebott@linux.vnet.ibm.com \
    --cc=gregkh@suse.de \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®