Skip to contentSkip to conversation

grey- and blacklisting drivers [Was: Re: Using the "best available" driver]

DISCUSSION Dominik Brodowski 4 participants 5 messages Dec 7, 2005 – Dec 8, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

For various reasons, it might be necessary to switch to a better driver for a device -- Jean can tell of many examples, if needed. Currently, that's possible using modprobe's blacklisting capability (in module-init-tools-3.2.1, at least) -- but that's for monolithic kernels only. While a blacklisting feature might also come useful in the kernel driver core level, udev may offer the chance to fix some broken "bindings" if there's need to. We'd need a simple shell script like

#/bin/bash
#

# needs 4 arguments: devpath bus wrong_driver right_driver
#
$drivername = basename $(readlink /sys/$1/driver)
$device = basename $1
$bus = $2
$wrong_driver = $3
$right_driver = $4

if [ $drivername = $wrong_driver ]; then

	echo -n "$device" > /sys/$devpath/driver/unbind
	echo -n "$device" > /sys/bus/$2/$right_driver/driver/bind

fi;

Then adding udev rules like

ACTION="add", BUS="pci", RUN+="/bin/sh -c /sbin/check_blacklist $devpath $bus hostap_pci orinoco_pci'"

is very easy, and such rules could even be generated by yet another tool which then echos into all relevant "uevent" files to run this script..

Or is all this already implemented? But differently? Should it be done at the kernel driver core level?

Thanks,
Dominik

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 7 lines · Dominik Brodowski

Hi,

For various reasons, it might be necessary to switch to a better driver for a device -- Jean can tell of many examples, if needed. Currently, that's possible using modprobe's blacklisting capability (in module-init-tools-3.2.1, at least) -- but that's for monolithic kernels only.

Why is the blacklisting for monolithic kernels only?

Bill

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Dominik Brodowski
Quoted 9 lines · Bill Nottingham
Quoted 7 lines · Dominik Brodowski

Hi,

For various reasons, it might be necessary to switch to a better driver for a device -- Jean can tell of many examples, if needed. Currently, that's possible using modprobe's blacklisting capability (in module-init-tools-3.2.1, at least) -- but that's for monolithic kernels only.

Quoted 3 lines

Why is the blacklisting for monolithic kernels only?

Bill

Actually, I think Dominik inverted the two and that
blacklisting apply only to modular kernel and would fail with monolithic kernel (because the drivers are already pre-loaded).
Anyway, that's not the point, and it does not really
matter. The point is that blacklisting is clearly not able to deal with the reality and complexity of Pcmcia drivers (even for fully modular kernels). If you want more details, feel free to check the archive of the Pcmcia mailing list.
Therefore, Dominik is proposing a per card overide using the
unbind/bind feature.

	Have fun...

	Jean

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Dominik Brodowski
Quoted 28 lines · Dominik Brodowski

Hi,

For various reasons, it might be necessary to switch to a better driver for a device -- Jean can tell of many examples, if needed. Currently, that's possible using modprobe's blacklisting capability (in module-init-tools-3.2.1, at least) -- but that's for monolithic kernels only. While a blacklisting feature might also come useful in the kernel driver core level, udev may offer the chance to fix some broken "bindings" if there's need to. We'd need a simple shell script like

#/bin/bash
#

# needs 4 arguments: devpath bus wrong_driver right_driver
#
$drivername = basename $(readlink /sys/$1/driver)
$device = basename $1
$bus = $2
$wrong_driver = $3
$right_driver = $4

if [ $drivername = $wrong_driver ]; then

	echo -n "$device" > /sys/$devpath/driver/unbind
	echo -n "$device" > /sys/bus/$2/$right_driver/driver/bind

fi;

Then adding udev rules like

Quoted 8 lines

ACTION="add", BUS="pci", RUN+="/bin/sh -c /sbin/check_blacklist $devpath $bus hostap_pci orinoco_pci'"

is very easy, and such rules could even be generated by yet another tool which then echos into all relevant "uevent" files to run this script..

Or is all this already implemented? But differently? Should it be done at the kernel driver core level?

So what is the main problem you are trying to fix here? Drivers binding to devices that they should not bind to? Why are they binding to these devices in the first place? Would something like the libusual code in -mm work better for this instead?

thanks,

greg k-h

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Dominik Brodowski
Quoted 1 line · Greg KH

Hi Greg,

Welcome on board.

Quoted 1 line

So what is the main problem you are trying to fix here?

To get you up to speed, you may want to read these :
http://lists.infradead.org/pipermail/linux-pcmcia/2005-December/002957.html
http://lists.infradead.org/pipermail/linux-pcmcia/2005-December/002997.html

The problem to resolve : two Pcmcia drivers with partial
hardware overlap. This happen quite often in the Pcmcia/Wireless world.
Basically, we want to offer fine grained control over driver
binding in a user friendly way and push that in distros. The basic infrastructure is there (sysfs bind/unbind), what's missing is the user friendly wrapping around (automatic on hotplug event, nice config file, ...).

Quoted 1 line

Drivers binding to devices that they should not bind to?

No, that's not what we are trying to solve.

Quoted 1 line

Why are they binding to these devices in the first place?

Because those drivers do support the device.

Quoted 1 line

Would something like the libusual code in -mm work better for this instead?

I personally don't know what it does.

Quoted 3 lines

thanks,

greg k-h

	Have fun...

	Jean

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel