17

Related Question

I can't reload a kernel module for trying new flags.
Example: thinkpad_acpi default is without fan_control=1. So if my computer runs really hot and the fans don't go to full speed it might sometimes be usable to just temporary load the module with fan_control and set the fan for a several minutes to the highest possible speed and change everything back to normal afterwords.
This isn't possible because it seems that some kernel modules depend to others and it seems that modern Linux kernels are checking that.
So what did I do so far:

  • Checking the dependencies
    • modinfo -F depends thinkpad_acpi
  • Try to unload these modules
    • rmmod or modprobe -r $dependencies
    • Some modules depend again to others, try to unload them too. Doesn't work, even if there are no 'dependencies' (or at least modinfo tells me that)
  • Google a lot for modprobe: FATAL: Module x is in use.
  • Reading tldp
queryAllThings
  • 181
  • 1
  • 1
  • 7
  • You could always change the option and reboot. A better question is why your computer is heating up. – terdon Oct 04 '14 at 14:20
  • Sorry, a reboot is exactly what I don't want to do and my computer might turn hot because the CPU load is fast, or the lid is closed, or the computer is outside and the sun is shining ;). – queryAllThings Oct 04 '14 at 14:41
  • OK, another option would be to control your fan speed. Have a look at the relevant tthinkwiki page: http://www.thinkwiki.org/wiki/How_to_control_fan_speed – terdon Oct 04 '14 at 15:07
  • 2
    I know! Quote: To enable fan control, the module parameter fan_control=1 must be given to thinkpad-acpi. I just want to know if it's possible to reload a kernel module. If I'm debugging wireless it's also necessary to reload some modules with other flags. – queryAllThings Oct 05 '14 at 06:35
  • Don't know how to do with snd_hda_intel: `$ sudo rmmod -f snd_hda_intel rmmod: ERROR: ../libkmod/libkmod-module.c:769 kmod_module_remove_module() could not remove 'snd_hda_intel': Resource temporarily unavailable rmmod: ERROR: could not remove module snd_hda_intel: Resource temporarily unavailable` :\ – Tomislav Nakic-Alfirevic Feb 24 '17 at 08:42

1 Answers1

5

If force unload is enabled in the kernel (zgrep FORCE_UNLOAD /proc/config.gz says =y), you can rmmod -f the problematic kernel module, to force unload it.

According to the patch that enables this, this is only for kernel developers and desperate people.

The best is probably to figure out why the module is in use, and by which process, but at least force unloading should make it possible to reload the module again.

Alexander
  • 9,607
  • 3
  • 40
  • 59