rules: avoid reading DRIVER for devices without modalias
PATCH 1/1 rules: avoid reading DRIVER for devices without modalias
DRIVER requires a readlink() in sysfs. The MODALIAS key is provided by uevent and requires no additional read. Test MODALIAS first.
rules/rules.d/80-drivers.rules +1 -1
@@ -2,7 +2,7 @@ ACTION!="add", GOTO="drivers_end" -DRIVER!="?*", ENV{MODALIAS}="?*", RUN{ignore_error}+="/sbin/modprobe -b $env{MODALIAS}" +ENV{MODALIAS}="?*", DRIVER!="?*", RUN{ignore_error}+="/sbin/modprobe -b $env{MODALIAS}" SUBSYSTEM="tifm", ENV{TIFM_CARD_TYPE}="SD", RUN+="/sbin/modprobe -b tifm_sd" SUBSYSTEM="tifm", ENV{TIFM_CARD_TYPE}="MS", RUN+="/sbin/modprobe -b tifm_ms" SUBSYSTEM="memstick", RUN+="/sbin/modprobe -b --all ms_block mspro_block"
Quoted 2 lines · Alan Jenkins
DRIVER requires a
readlink()in sysfs. The MODALIAS key is provided by uevent and requires no additional read. Test MODALIAS first.
Are you sure that makes a difference? We *should* sort the keys while parsing, and run the cheaper ones before the more expensive ones. At least that's how it was before the rewrite of the parser, and it *should* be still the same today.
Thanks,
Kay
Quoted 6 lines · Kay Sievers
Quoted 3 lines · Alan Jenkins
DRIVER requires a
readlink()in sysfs. The MODALIAS key is provided by uevent and requires no additional read. Test MODALIAS first.
Quoted 8 lines
Are you sure that makes a difference? We *should* sort the keys while parsing, and run the cheaper ones before the more expensive ones. At least that's how it was before the rewrite of the parser, and it *should* be still the same today.
Thanks,
Kay
Sorry, I'd forgotten that. You're right it makes no difference.
Re: [PATCH] rules: avoid reading DRIVER for devices without
In reply to Alan JenkinsQuoted 2 lines · Alan Jenkins
DRIVER requires a
readlink()in sysfs. The MODALIAS key is provided by uevent and requires no additional read. Test MODALIAS first.
What is the point of checking both DRIVER and ENV{MODALIAS}? The Debian rules files always checked only ENV{MODALIAS}.
Signature · 2 lines
ciao, Marco
Quoted 9 lines · Marco d'Itri
Quoted 3 lines · Alan Jenkins
DRIVER requires a
readlink()in sysfs. The MODALIAS key is provided by uevent and requires no additional read. Test MODALIAS first.What is the point of checking both DRIVER and ENV{MODALIAS}? The Debian rules files always checked only ENV{MODALIAS}.
I think the idea is to avoid calling modprobe if the driver was built into the kernel (or the module is already loaded).
Alan
Re: [PATCH] rules: avoid reading DRIVER for devices without
In reply to Alan JenkinsQuoted 2 lines · Alan Jenkins
Quoted 2 lines
What is the point of checking both DRIVER and ENV{MODALIAS}? The Debian rules files always checked only ENV{MODALIAS}.
Nevermind, this is not true...
Signature · 2 lines
ciao, Marco