Re: [RFC] [PATCH] driver core: allow userspace to unbind drivers from devices.

Dmitry Torokhov
2004-11-16T06:38:06Z

On Tuesday 16 November 2004 01:13 am, Adam Belay wrote:
> An Alternative Solution
> =======================
>
> Why not have a file named "bind". We can write the name of the driver we want
> bound to the device. When we want to unbind the driver we could do something
> like this:
>
> # echo "" > bind
> or
> # echo 0 > bind
>
> At least then we only have the link and the "bind" file to worry about. I've
> also been considering more inventive solutions (like deleting the symlink will
> cause the driver to unbind). But it could get complex very quickly. Really,
> we need to discuss this more.
>

I'd like having one node as well. Right now serio bus uses "drvctl" and supports
the following operations:
- "none" to unbind;
- "rescan" to unbind if bound and then find appropriate driver;
- "reconnect" to reinitialize hardware without inbinding (so exesting input
devices will be kept intact)
- <driver name> to unbind if bound and try to bind.

There was also ide of changing commands to form "CMD [DRIVER] [ARGS...]:
"detach", "rescan", "reconnect", "attach <driver_name>"

My bind mode patch is somewhat independent of "drvctl" as it just adds a new
attribute - "bind_mode" to all devices and drivers. It can be either "auto"
or "manual" and device/drivers that are set as manual mode will be ignored
by driver core and will only be bound when user explicitely asks to do that.
This is useful when you want "penalize" one driver over another, like
psmouse/serio_raw.

--
Dmitry