37

I'm following this tutorial to get my card reader working: http://ubuntuforums.org/showthread.php?t=636867

However I'm unable unload my sdhci module:

sudo modprobe -rv sdhci mmc_core mmc_block
modprobe: FATAL: Module sdhci is in use.

How should I proceed?

4
  • By what other modules is sdhci used?
    – s3lph
    Sep 7, 2014 at 17:49
  • That's what I don't know how to find out Sep 7, 2014 at 17:50
  • lsmod | grep sdhci
    – s3lph
    Sep 7, 2014 at 17:52
  • unloading sdhci_pci fixed it. Thanks! Wanna write that into an answer? Sep 7, 2014 at 17:54

2 Answers 2

32

First, find out, which other modules use the module sdhci:

lsmod | grep sdhci

You will get a list like this:

module size used_by

Try unloading these modules (used_by) before or together with the module you want to unload:

sudo modprobe -r <module found from lsmod> <module you want to remove>

If you want to prevent the module from loading on the next boot, add it to the blacklist:

echo -e "sdhci\n" | sudo tee -a /etc/modprobe.d/blacklist.conf
4
  • 3
    I tried this but didn't have any luck: askubuntu.com/questions/724052/…
    – guttermonk
    Jan 22, 2016 at 2:23
  • 17
    What if I get "used by 1" but it does not says which one?
    – Alejo Dev
    Jun 2, 2020 at 15:20
  • 2
    @AlejoDev the same for me. I get 'used by' value just 3.
    – Chan Kim
    Aug 18, 2021 at 5:38
  • 3
    A line sdhci in /etc/modprobe.d/blacklist.conf will not work. The line should be blacklist sdhci in etc/modprobe.d/blacklist.conf
    – qwertz
    Jun 7, 2022 at 15:22
3

Another place to look at is "lsof" apart from unloading the dependent modules.

# lsof | grep < relevant str to module >

This should list the files that are opened via the module. Try killing those processes that opened the files and check the module reference count is getting reduced through the "lsmod" command.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .