Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to "rmmod" the module

I'm working with a large embedded software (ARM processor, embedded linux 2.6.31, busybox) involving both kernel and user space code. There's a kernel module normally loaded first, and daemon establishing netlink socket with the module.

The issue here is that after killing the daemon, I'm no longer able to unload the module from the memory:

% rmmod _module.ko
% rmmod: _module.ko: Resource temporarily unavailable

Analysis has shown that error (return value is -11, i.e. EAGAIN?) is returned by try_stop_module() invoked in syscall delete_module() definition in kernel/module.c. Function try_stop_module() in turn calls stop_machine() and this is where I've stuck, as

I'm not sure what's exactly happening there. I think the root cause is somewhere in the daemon that opens connections to the module and obviously something else and doesn't correctly close/clean-up on exit (apparently some references/locks are not released?)

Does anybody have any idea what else to look at and probe?

like image 363
Mark Avatar asked Dec 12 '12 19:12

Mark


1 Answers

Check whether all the interfaces related to your module is not 'up'.

if any of the interface which is related to your module is 'up',then rmmod will fail and returns with -11.

So before calling rmmod, check the active interfaces using 'netcfg' command. then using ifconfig,make your interface down as 'ifconfig <interface_name> down'

then try to run rmmod <module_name>. it will work!!

1.netcfg <lists out all interfaces>
2.ifconfig <interface_name> down
3.rmmod <module_name>
like image 85
Nandan_G Avatar answered Sep 22 '22 12:09

Nandan_G