How to unload kernel module?

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

How to unload kernel module?

Josef Wolf
Hello,

I'd like to debug a kernel module.  For that, I want to unload the
module that was loaded at boot.  I remember in the old days, you
could simply "modprobe -r modname" to get rid of it.  But nowadays,
with all this udev/hal/debus/whatever, I am somewhat lost.  Here is
what I would like to get rid of:

  raven:/ # lsmod | egrep '(299|dvb|budget)'
  stv0299                11280  1
  budget_ci              18956  0
  budget_core            12332  1 budget_ci
  dvb_core               87948  3 stv0299,budget_ci,budget_core
  saa7146                18080  2 budget_ci,budget_core
  ttpci_eeprom            2520  1 budget_core
  ir_common              43340  1 budget_ci
  i2c_core               35280  5 stv0299,budget_ci,budget_core,ttpci_eeprom,i2c_piix4
  raven:/ #

See the use-count of stv0299?  How do I find out which component uses
it and how do I get rid of it?
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

jdd@dodin.org
Josef Wolf a écrit :
> Hello,
>
> I'd like to debug a kernel module.  For that, I want to unload the
> module that was loaded at boot.  I remember in the old days, you
> could simply "modprobe -r modname" to get rid of it.

rmmod worked for me recently

jdd
--
http://www.dodin.net
http://valerie.dodin.org
http://www.youtube.com/watch?v=t-eic8MSSfM
http://www.facebook.com/profile.php?id=1412160445

--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: How to unload kernel module?

Josef Wolf
On Fri, Feb 20, 2009 at 05:57:28PM +0100, jdd wrote:
> Josef Wolf a écrit :
> > Hello,
> >
> > I'd like to debug a kernel module.  For that, I want to unload the
> > module that was loaded at boot.  I remember in the old days, you
> > could simply "modprobe -r modname" to get rid of it.
>
> rmmod worked for me recently

Thanks for the quick answer.  Unfortunately, rmmod will not remove
the module because its use-count is still 1 although no applications
are currently using /dev/dvb/*.

raven:/ # lsof | grep /dev/dvb
raven:/ #
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

jdd@dodin.org
In reply to this post by jdd@dodin.org
Josef Wolf a écrit :

> Thanks for the quick answer.  Unfortunately, rmmod will not remove
> the module because its use-count is still 1 although no applications
> are currently using /dev/dvb/*.

well... the raw method is to stop the service that uses this module (I
don't know what one it's):

rc <TAB> as root will list all the services (or /etc/init.d/ <TAB>)
<TAB> meaning press the TAB key once or twice

jdd

--
http://www.dodin.net
http://valerie.dodin.org
http://www.youtube.com/watch?v=t-eic8MSSfM
http://www.facebook.com/profile.php?id=1412160445

--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

Pete Connolly
In reply to this post by Josef Wolf
On Friday 20 Feb 2009 16:26:18 Josef Wolf wrote:

> Hello,
>
> I'd like to debug a kernel module.  For that, I want to unload the
> module that was loaded at boot.  I remember in the old days, you
> could simply "modprobe -r modname" to get rid of it.  But nowadays,
> with all this udev/hal/debus/whatever, I am somewhat lost.  Here is
> what I would like to get rid of:
>
>   raven:/ # lsmod | egrep '(299|dvb|budget)'
>   stv0299                11280  1
>   budget_ci              18956  0
>   budget_core            12332  1 budget_ci
>   dvb_core               87948  3 stv0299,budget_ci,budget_core
>   saa7146                18080  2 budget_ci,budget_core
>   ttpci_eeprom            2520  1 budget_core
>   ir_common              43340  1 budget_ci
>   i2c_core               35280  5
stv0299,budget_ci,budget_core,ttpci_eeprom,i2c_piix4
>   raven:/ #
>
> See the use-count of stv0299?  How do I find out which component uses
> it and how do I get rid of it?

Hi Josef

Have you tried an rmmod -rf «module-name»  to see if you can force remove it
recursively?  If it works, it may leave your system in  an unstable state, but
it's worth a try.

Cheers

Pete
 


--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

Ken Schneider - openSUSE
In reply to this post by Josef Wolf
Josef Wolf pecked at the keyboard and wrote:

> Hello,
>
> I'd like to debug a kernel module.  For that, I want to unload the
> module that was loaded at boot.  I remember in the old days, you
> could simply "modprobe -r modname" to get rid of it.  But nowadays,
> with all this udev/hal/debus/whatever, I am somewhat lost.  Here is
> what I would like to get rid of:
>
>   raven:/ # lsmod | egrep '(299|dvb|budget)'
>   stv0299                11280  1
>   budget_ci              18956  0
>   budget_core            12332  1 budget_ci
>   dvb_core               87948  3 stv0299,budget_ci,budget_core
>   saa7146                18080  2 budget_ci,budget_core
>   ttpci_eeprom            2520  1 budget_core
>   ir_common              43340  1 budget_ci
>   i2c_core               35280  5 stv0299,budget_ci,budget_core,ttpci_eeprom,i2c_piix4
>   raven:/ #
>
> See the use-count of stv0299?  How do I find out which component uses
> it and how do I get rid of it?

First you need to rmmod the modules used in other modules i.e.

rmmod budget_ci  before  you rmmod budget_core

--
Ken Schneider
SuSe since Version 5.2, June 1998
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

Patrick Shanahan-2
In reply to this post by Josef Wolf
* Josef Wolf <[hidden email]> [01-01-70 12:34]:
>
> See the use-count of stv0299?  How do I find out which component uses
> it and how do I get rid of it?
>

A google search for "linux kernel module stv0299" reveals discussion.


--
Patrick Shanahan         Plainfield, Indiana, USA        HOG # US1244711
http://wahoo.no-ip.org     Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535                    @ http://counter.li.org
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

Josef Wolf
In reply to this post by Ken Schneider - openSUSE
On Fri, Feb 20, 2009 at 02:39:52PM -0500, Ken Schneider wrote:

> Josef Wolf pecked at the keyboard and wrote:
> > Hello,
> >
> > I'd like to debug a kernel module.  For that, I want to unload the
> > module that was loaded at boot.  I remember in the old days, you
> > could simply "modprobe -r modname" to get rid of it.  But nowadays,
> > with all this udev/hal/debus/whatever, I am somewhat lost.  Here is
> > what I would like to get rid of:
> >
> >   raven:/ # lsmod | egrep '(299|dvb|budget)'
> >   stv0299                11280  1
> >   budget_ci              18956  0
> >   budget_core            12332  1 budget_ci
> >   dvb_core               87948  3 stv0299,budget_ci,budget_core
> >   saa7146                18080  2 budget_ci,budget_core
> >   ttpci_eeprom            2520  1 budget_core
> >   ir_common              43340  1 budget_ci
> >   i2c_core               35280  5 stv0299,budget_ci,budget_core,ttpci_eeprom,i2c_piix4
> >   raven:/ #
> >
> > See the use-count of stv0299?  How do I find out which component uses
> > it and how do I get rid of it?
>
> First you need to rmmod the modules used in other modules i.e.
>
> rmmod budget_ci  before  you rmmod budget_core

OK, that helps.  Thanks Ken!

But I still don't understand why the dependency is not listed for
the stv0299 module?  And how would I find out (without asking the net)
that budget_ci is the module that keeps stv0299 from being released?

--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: How to unload kernel module?

Ken Schneider - openSUSE
Josef Wolf pecked at the keyboard and wrote:

> On Fri, Feb 20, 2009 at 02:39:52PM -0500, Ken Schneider wrote:
>> Josef Wolf pecked at the keyboard and wrote:
>>> Hello,
>>>
>>> I'd like to debug a kernel module.  For that, I want to unload the
>>> module that was loaded at boot.  I remember in the old days, you
>>> could simply "modprobe -r modname" to get rid of it.  But nowadays,
>>> with all this udev/hal/debus/whatever, I am somewhat lost.  Here is
>>> what I would like to get rid of:
>>>
>>>   raven:/ # lsmod | egrep '(299|dvb|budget)'
>>>   stv0299                11280  1
>>>   budget_ci              18956  0
>>>   budget_core            12332  1 budget_ci
>>>   dvb_core               87948  3 stv0299,budget_ci,budget_core
>>>   saa7146                18080  2 budget_ci,budget_core
>>>   ttpci_eeprom            2520  1 budget_core
>>>   ir_common              43340  1 budget_ci
>>>   i2c_core               35280  5 stv0299,budget_ci,budget_core,ttpci_eeprom,i2c_piix4
>>>   raven:/ #
>>>
>>> See the use-count of stv0299?  How do I find out which component uses
>>> it and how do I get rid of it?
>> First you need to rmmod the modules used in other modules i.e.
>>
>> rmmod budget_ci  before  you rmmod budget_core
>
> OK, that helps.  Thanks Ken!
>
> But I still don't understand why the dependency is not listed for
> the stv0299 module?  And how would I find out (without asking the net)
> that budget_ci is the module that keeps stv0299 from being released?
>

That I don't have the answer to.

--
Ken Schneider
SuSe since Version 5.2, June 1998
--
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re: How to unload kernel module?

Boyd Stephen Smith Jr.-3
In reply to this post by Josef Wolf
On Friday 20 February 2009 11:37:14 Josef Wolf wrote:
> Thanks for the quick answer.  Unfortunately, rmmod will not remove
> the module because its use-count is still 1 although no applications
> are currently using /dev/dvb/*.

rmmod -f, but only if you are sure nothing it using it.  It will get unloaded
and if something tries to use it, you'll get a panic or worse.
--
Boyd Stephen Smith Jr.                   ,= ,-_-. =.
[hidden email]                   ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'
http://iguanasuicide.net/                    \_/


signature.asc (204 bytes) Download Attachment