Vendor driver vs Kernel, which one gets priority?
Bjørn Mork
bjorn at mork.no
Wed Oct 19 13:03:06 EDT 2022
Do Hak Yong <crazyraven at gmail.com> writes:
> Hello kernel experts,
>
> I have a few questions about the priority of kernel drivers and third party
> drivers.
>
> If I install a third party vendor driver, which has the same module name as
> kernel provides, for example, Qlogic driver has the same module name as
> third party driver(qla2xxx).
>
> The questions are:
>
> Q1. Which driver has higher priority and which driver will be used? will
> there any be problems?
See depmod.d(5).
Unless overridden by config, modules in /lib/modules/$(uname -r)/updates
have priority over other modules. This can be used to replace kernel
modules with a third party driver.
The third party driver could also use a startup script to forcibly
replace already loaded modules.
> Q2. How to control which driver the os will use?
If the file names are identical, then use the "updates" directory or
configure another location to have priority over the kernel modules.
If the file names are different, then you can blacklist the kernel
module to make sure the third party module is the only one available for
auto-loading. See modprobe.d(5)
> Q3. What if the updated kernel installed and provied higher driver version
> than third party? Which one will be used then?
The default is to consider only the modules in /lib/modules/$(uname -r)
Any third party module must be updated along with the kerne. Or copied
into the new location if binary compatible. But that's not likely in
general.
> I think third party drivers have more precedence that kernel drivers refer
> to below Red Hat KB, but I'm not sure which one will be used when the
> kernel has updated.
>
> https://access.redhat.com/solutions/176213
Redhat uses a more complex depmod configuration than default. You
should probably ask them about their setup. Or just look at the config
in /etc/depmod.d/*.conf
Bjørn
More information about the Kernelnewbies
mailing list