内置驱动程序是否总是优先于可加载模块?
Are builtin driver always prioritized over loadable modules?
根据this note:
When multiple built-in modules (especially drivers) provide the same
capability, they're prioritized by link order specified by the order
listed in Makefile.
此外:
However, the order in this file is
indeterministic (depends on filesystem listing order of installed
modules). This causes confusion.
The solution is two-parted. This patch updates kbuild such that it
generates and installs modules.order which contains the name of
modules ordered according to Makefile.
如果系统有多个驱动程序提供相同的功能,其中一些是内置模块,另一些是可加载模块,会发生什么情况?
在这种情况下,哪个优先?它总是内置的吗?我该如何更改优先级(如果可能的话)?
我考虑过在 modules.alias 或 modules.order 中对它们重新排序,但我猜这行不通,因为那里没有列出内置插件 - 对吗?
我认为没有优先级。如果你有相同的驱动程序实例(一个来自内置,另一个来自内核模块),最终你会因为重复定义或其他原因而出现编译错误或模块加载错误。
如果您在同一硬件上有 "DIFFERENT" 个驱动程序,不确定您为什么这样做?
此外,如果有人已经探测并创建了设备,则后面的人不能做同样的事情,因为会发生冲突。
如果你只是在内置模块和 LKM 之间询问 "precedence",那么内置模块肯定是第一个。内核模块位于与内核不同的内存位置。所以,LKM 比内核加载晚。
因此,如果您同时以两种不同的方式加载同一个驱动程序,LKM 将因冲突而出现问题。
同时我找到了答案并将其记录在此处:
http://0x0001.de/linux-driver-loading-registration-and-binding
长话短说:
是的,内置驱动程序通常优先于可加载驱动程序。
只是因为他们在绑定时先注册和"first comes first serves"原则。
根据this note:
When multiple built-in modules (especially drivers) provide the same capability, they're prioritized by link order specified by the order listed in Makefile.
此外:
However, the order in this file is indeterministic (depends on filesystem listing order of installed modules). This causes confusion.
The solution is two-parted. This patch updates kbuild such that it generates and installs modules.order which contains the name of modules ordered according to Makefile.
如果系统有多个驱动程序提供相同的功能,其中一些是内置模块,另一些是可加载模块,会发生什么情况?
在这种情况下,哪个优先?它总是内置的吗?我该如何更改优先级(如果可能的话)?
我考虑过在 modules.alias 或 modules.order 中对它们重新排序,但我猜这行不通,因为那里没有列出内置插件 - 对吗?
我认为没有优先级。如果你有相同的驱动程序实例(一个来自内置,另一个来自内核模块),最终你会因为重复定义或其他原因而出现编译错误或模块加载错误。
如果您在同一硬件上有 "DIFFERENT" 个驱动程序,不确定您为什么这样做?
此外,如果有人已经探测并创建了设备,则后面的人不能做同样的事情,因为会发生冲突。
如果你只是在内置模块和 LKM 之间询问 "precedence",那么内置模块肯定是第一个。内核模块位于与内核不同的内存位置。所以,LKM 比内核加载晚。
因此,如果您同时以两种不同的方式加载同一个驱动程序,LKM 将因冲突而出现问题。
同时我找到了答案并将其记录在此处: http://0x0001.de/linux-driver-loading-registration-and-binding
长话短说: 是的,内置驱动程序通常优先于可加载驱动程序。 只是因为他们在绑定时先注册和"first comes first serves"原则。