Re: How to prevent a module from unloading when in used
Hi, I am facing an issues with module unloading, I have two modules say A, B A depends on B, so B is automatically loaded when A is loaded. B module is also directly being used by the user side code via misc interface. Now when I am unloading module A, via "modprobe -r A" it is also unloading the module B which is being used by the application and resulting in the kernel crash. Also, lsmod ouput shows driver B is not used by anybody. Seems "Used By" of lsmod output is not getting updated. How to prevent unloading of module B in used. When unloading module 'A' via modprobe -r Thanks, Chetan Nanda
On Wed, Jul 16, 2014 at 04:00:18PM +0530, Chetan Nanda wrote:
A depends on B, so B is automatically loaded when A is loaded. B module is also directly being used by the user side code via misc interface. . Now when I am unloading module A, via "modprobe -r A" it is also unloading the module B which is being used by the application and resulting in the kernel crash.
You said that A depends on B, right? Why do you have A dependng on B? If it A needs to have B then it makes sense that you can not remove A while B is in use. If A doesn't need B, why not remove the dependency.
Hi, Is their some special reason for not using "rmmod" to unload module? rmmod will remove only the module which it is told to remove. Regards, Abhishek Sharma On Wednesday 16 July 2014 04:00 PM, Chetan Nanda wrote:
Hi,
I am facing an issues with module unloading, I have two modules say A, B
A depends on B, so B is automatically loaded when A is loaded. B module is also directly being used by the user side code via misc interface.
Now when I am unloading module A, via "modprobe -r A" it is also unloading the module B which is being used by the application and resulting in the kernel crash.
Also, lsmod ouput shows driver B is not used by anybody. Seems "Used By" of lsmod output is not getting updated.
How to prevent unloading of module B in used. When unloading module 'A' via modprobe -r
Thanks, Chetan Nanda
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
participants (3)
-
Abhishek Sharma -
Chetan Nanda -
John de la Garza