lkml.org 
[lkml]   [2010]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] bind/unbind uevent
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?

> 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.

> 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


\
 
 \ /
  Last update: 2010-12-07 17:31    [W:0.117 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site