public inbox for kernelnewbies@kernelnewbies.org
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: Do Hak Yong <crazyraven@gmail.com>
Cc: kernelnewbies@kernelnewbies.org
Subject: Re: Vendor driver vs Kernel, which one gets priority?
Date: Wed, 19 Oct 2022 19:03:06 +0200	[thread overview]
Message-ID: <87a65rsq45.fsf@miraculix.mork.no> (raw)
In-Reply-To: <CAFu1jQ3Rby2QK65JPHJEPkLmWTqb8W-P08-=m9ErcrJXsa-_Eg@mail.gmail.com> (Do Hak Yong's message of "Thu, 20 Oct 2022 00:03:26 +0900")

Do Hak Yong <crazyraven@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

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2022-10-19 17:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 15:03 Vendor driver vs Kernel, which one gets priority? Do Hak Yong
2022-10-19 17:03 ` Bjørn Mork [this message]
2022-10-20 10:31   ` Do Hak Yong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a65rsq45.fsf@miraculix.mork.no \
    --to=bjorn@mork.no \
    --cc=crazyraven@gmail.com \
    --cc=kernelnewbies@kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox