Janet,
Here's the output from the lsmod command on my system here:
Module Size Used by
lvi 13036 0
rtl_sched 40936 0 (lvi)
rtl_time 10164 0 [rtl_sched]
rtl 25984 0 [rtl_sched rtl_time]
The "only" order that will work is
rmmod lvi # depends on nothing
rmmod rtl_time # depends on nothing
rmmod rtl_sched # was used by rtl_time
rmmod rtl # finally unused
BUT... The counts under used-column show the usage count as reflected by
MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT (if you use them). If these aren't
zero, you can't remove the module. If you don't use them, IIRC, they should
always be zero. In all of my drivers that use the MOD_xxx_USE_COUNT
mechanism for counting usage, I provide an ioctl-mechanism for setting the
USE_COUNT to zero regardless of what's actually going on. This is -- of
course -- a last-resort trick, but it does allow me to remove modules which
didn't get to DEC_ because a user-program terminated with extreme prejudice
and never closed the open device(s).
That's the extent of what I know about it. You might find more in Rubini
and you'll find a lot in the kernel source code (a court of last resort
IMHO);
Norman Dresner
Fellow Systems Engineer &(SGI) Advanced Signal Processing Laboratory
Administrator
Radar Systems Engineering Department
Electronic Systems and Sensors Segment
Northrop Grumman Corporation
Baltimore-Washington International Airport
7323 Aviation Boulevard
Baltimore Maryland 21240
Voice: (410) 993 - 2096 Mornings; all-day voice-mail
(410) 969 - 8068 Afternoons with answering machine
FAX: (410) 993 - 8084 On-site
(410) 969 - 8068 Afternoons; call first to arrange
E-Mail: Mornings: mailto:[EMAIL PROTECTED]
Afternoons: mailto:[EMAIL PROTECTED]
----- Original Message -----
From: Estabridis, Janet P <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 31, 2001 10:28 AM
Subject: [rtl] Can't Unload Modules - "in use"
> Hi,
> Sorry I am not at my machine to get the exact message and I haven't gotten
> to check the archives, but I figure someone can steer me in the correct
> direction.
>
> I am using RTLV2.3 with kernel 2.2.14
>
>
> I have four modules, three of them just contain routines that the main
> modules calls.
>
> bit.o
> vig.o
> tspi.o
> rt_main.o
>
> When I try and remove the modules with "rmmod" I get that it can't be
> removed because the modules are in use. I use "lsmod" and try and remove
> them in the correct order, but still it won't let me remove any of them.
I
> have to re-boot.
>
> So, the big question is - What am I doing wrong ? Do my modules that only
> have routines need to have "init_module" and "cleanup_module" ?
> Do I need to use the linker to create one big "rt_main.o" ? I tried that
> but got some errors.
>
> Thanks in advance =
> Janet Estabridis
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
>
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/