-   Linux - Kernel (
-   -   module load order causing failure (

jsb1 10-18-2021 04:54 PM

module load order causing failure
I have an issue, where a kernel driver module I'm working on is calling an ACPI method. This method is accessing IPMI operation region, which will fail if the driver for the IPMI controller isn't loaded yet... so, during boot, my module gets loaded, and it fails, and almost immediately afterward the IPMI driver is loaded. If I then unload and reload my driver, it will work.

But my driver does not DEPEND on IPMI... it just happens to depend on it in this system, because the ACPI method I'm running uses an IPMI Op Region (though it likely does not do so on some systems). So my driver could work just fine on other systems that don't even have IPMI. The ACPI method I'm running is a _DSM that's under a PCI device in an ?SDT ACPI table, FWIW.

Is there any way to make this just work right, without having to add special udev rules or scripts just for this system? I'm not sure what the right solution would be.

hazel 10-20-2021 10:27 AM

The modprobe.d man page suggests this, which could be what you need:

install modulename command...
This is the most powerful primitive: it tells modprobe to run your command instead of inserting the module in the kernel as normal. The command can be any shell command: this allows you to do any kind of complex processing you might wish. For example, if the module "fred" works better with the module "barney" already installed (but it doesn't depend on it, so modprobe won't automatically load it), you could say "install fred /sbin/modprobe barney; /sbin/modprobe --ignore-install fred", which would do what you wanted. Note the --ignore-install, which stops the second modprobe from running the same install command again.

All times are GMT -5. The time now is 12:03 PM.