lkml.org 
[lkml]   [2013]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: (re-)binding the VFIO platform driver to a platform device
On Thu, Oct 03, 2013 at 02:11:34PM -0500, Scott Wood wrote:
> On Thu, 2013-10-03 at 11:54 -0700, gregkh@linuxfoundation.org wrote:
> > On Thu, Oct 03, 2013 at 01:33:27PM -0500, Scott Wood wrote:
> > > What it looks like we do still want from the driver core is the ability
> > > for a driver to say that it should not be bound to a device except via
> > > explicit sysfs bind,
> >
> > You can do that today by not providing any device ids in your driver
> > structure, relying on the dynamic ids the driver core creates.
>
> I'm not sure what you mean by dynamic ids,

The "new_id" file in sysfs for a driver.

> but if the driver doesn't provide any match data, then
> driver_match_device() will return 0 and bind_store() will fail.

bind/unbind in sysfs can override this, I think, maybe it needs to be
combined with the new_id file to work properly, it's been a long time
since I last looked at that code path.

> > > and the ability for a user to say that a device should not be bound to
> > > a driver except via explicit sysfs bind.
> >
> > That's not going to happen, as how can the kernel know a specific device
> > is going to want this, before it asks the drivers about it?
>
> This would normally be set by the user prior to unbinding from a
> different driver, though it would also be nice to be able to set it at
> boot time (e.g. via the kernel command line).

Do that for your driver then, if you really want this, but it's not
going into the driver core, sorry. It should never be parsing kernel
command lines, nor should you.

> > Or, just don't ever create a driver that matches that device, then rely
> > on userspace to do the binding explicitly.
>
> That breaks the normal use case where you want the device to be bound to
> the normal driver without doing anything special. And again,
> driver_match_device() will cause the bind to fail.

So, you are asking for something that really is impossible from what I
can tell. Please figure out _exactly_ the semantics of what you want,
as I'm totally confused and am giving up on this thread without seeing a
patch anywhere.

greg "back to patch review" k-h


\
 
 \ /
  Last update: 2013-10-03 23:01    [W:0.088 / U:1.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site