Re: [REPOST][PATCH 1/2] driver core: Add new device_driver flag toallow binding via sysfs only

From: Greg Kroah-Hartman
Date: Thu Dec 19 2013 - 19:00:37 EST


On Thu, Dec 19, 2013 at 11:08:55PM +0000, Stuart Yoder wrote:
> > > How will it "know not to grab the device"? The knowledge of whether
> > the
> > > binding was explicitly requested or not does not get passed through to
> > > the probe function.
> >
> > Nor should it, as a driver should not know, nor care about this.
> >
> > It's up to the BUS to handle this if it really wants to, and I'm afraid
> > that I really am not convinced that the driver core needs to handle it
> > either.
> >
> > But again, as you don't have anything that could actually use this code
> > that is mergable, it's a totally moot point, sorry.
>
> Understand, but what assumption do we develop vfio-plaform with? That
> a driver core 'sysfs_bind_only' flag is not an option, period? If that
> is the case we need to go back to square one and invent some new mechanism
> to bind devices to the vfio-platform driver.

Ok, why the total confusion between PCI and platform devices here? Why
keep mentioning both of them in a semi-interchangeable way?

> I guess it would need to be the platform bus equivalent of new_id.

Then add it, there's nothing stopping the platform bus from supporting
this.

> But, then we're left with the potential racy situation where multiple drivers
> can potentially grab a device and it's ambiguous and non-deterministic at to which
> driver binds to it.

Welcome to life in hotpluggable systems, this is nothing new :)

Seriously, userspace has the ability to sort this all out after devices
show up, use it. Don't try to create convoluted schemes in the driver
core that are confusing and don't really seem to work.

People have asked for a "priority" of drivers binding to devices for
over a decade now, as "other" operating systems have it. Turns out, no
one has ever needed it badly enough to actually implement it...

good luck,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/