public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Chmielewski <mangoo@wpkg.org>
To: linux-kernel@vger.kernel.org
Subject: why can't I remove a kernel module (or: what uses a given module)?
Date: Sun, 03 Dec 2006 12:20:47 +0100	[thread overview]
Message-ID: <4572B30F.9020605@wpkg.org> (raw)

There is something I don't understand about loading and unloading kernel 
modules.

I have a SATA controller, it uses a sata_mv driver.
The drive connected to it is not used; it just "merely exists" - no one 
touches it.
This is why I don't understand why I can't remove such a module:

1.

# rmmod sata_mv
ERROR: Module sata_mv is in use

The module was loaded automatically during the system boot.

mount claims no /dev/sda* partition is mounted.


2.

In a second scenario, I move the kernel:

# mv /lib/modules/2.6.19/kernel/drivers/ata/sata_mv.ko /root
# reboot

And load it later manually:

# insmod ./sata_mv
# dmesg -c
sata_mv 0000:01:00.0: version 0.7
ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 20 (level, low) -> IRQ 23
(...)
SCSI device sda: drive cache: write back
  sda: sda1
sd 24:0:0:0: Attached scsi disk sda


We can remove the module without problems:

# rmmod sata_mv
# dmesg -c
Synchronizing SCSI cache for disk sda:
ACPI: PCI interrupt for device 0000:01:00.0 disabled


Now I could remove the module without problems.


What was using the module in the first scenario (I couldn't remove the 
module)?


-- 
Tomasz Chmielewski
http://wpkg.org

             reply	other threads:[~2006-12-03 11:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-03 11:20 Tomasz Chmielewski [this message]
2006-12-03 11:34 ` why can't I remove a kernel module (or: what uses a given module)? Andreas Schwab
2006-12-03 11:58   ` Tomasz Chmielewski
2006-12-03 15:49     ` Ross Vandegrift
2006-12-03 19:59       ` Tomasz Chmielewski
2006-12-03 23:42         ` Jim Crilly
2006-12-04  8:02           ` Tomasz Chmielewski
2006-12-04 10:10         ` Tobias Oed
2006-12-04 10:39           ` Tomasz Chmielewski
2006-12-05  0:15           ` Michal Jaegermann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4572B30F.9020605@wpkg.org \
    --to=mangoo@wpkg.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox