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
  • You could always change the option and reboot. A better question is why your computer is heating up.
    – terdon
    Oct 4 '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 ;). Oct 4 '14 at 14:41
  • OK, another option would be to control your fan speed. Have a look at the relevant tthinkwiki page: thinkwiki.org/wiki/How_to_control_fan_speed
    – terdon
    Oct 4 '14 at 15:07
  • 1
    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. Oct 5 '14 at 6: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 :\ Feb 24 '17 at 8:42

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.

  • 2
    Which seems to be the default on Debian. PS: On Debian /proc/config.gz is located under /boot/config-$(uname -r).gz. Oct 24 '15 at 15:10
  • 1
    and grep FORCE_UNLOAD /boot/config-$(uname -r) on Ubuntu.
    – sabalaba
    Jul 21 '17 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.