<div><p class="MsoNormal">Dear all,</p>

<p class="MsoNormal"><span style="mso-tab-count:1">                </span>Thanks
for your suggestion. Finally, I identified the solution for the permanent
issued I faced after loading my kernel module. The solution is the kernel macro;
&#39;USE_IMMEDIATE&#39; has to be defined (to be given as -DUSE_IMMEDIATE along with
compiler flags) during compilation of my module. Actually, I don&#39;t know much
deep about the usage of this kernel macro and how it resolves the issue, but
one thing I came to know that it was used during module relocation while
inserting the module. If anyone help me to get know much about it, then it will
be fine. Also, for your information, I have used my own Makefile for
compilation of kernel loadable modules. So, I have to add myself this macro to
get rid of this permanent issue. Another fine solution is, you can make use of
kernel build Makefile itself (if linux kernel version is above 2.4) to build
your kernel loadable modules. Because it itself include all default macros and
flags needed for compilation of your module. I have specified below the sample Makefile
for compiling kernel loadable modules with kernel build Makefile.</p>

<p class="MsoNormal" style="line-height:normal"><b style="mso-bidi-font-weight:
normal">Reference:</b></p>

<p class="MsoNormal" style="line-height:normal">obj-m += hello.o</p>

<p class="MsoNormal" style="line-height:normal">all:</p>

<p class="MsoNormal" style="line-height:normal"><span style="mso-tab-count:1">                </span>make
-C /lib/modules/$(shell uname -r)/build M=$(PWD) modules</p>

<p class="MsoNormal" style="line-height:normal">clean:</p>

<p class="MsoNormal" style="line-height:normal"><span style="mso-tab-count:1">                </span>make
-C /lib/modules/$(shell uname -r)/build M=$(PWD) clean</p>

<p class="MsoNormal" style="line-height:normal"> </p>

<p class="MsoNormal" style="line-height:normal">Regards,</p>

<p class="MsoNormal" style="line-height:normal">Sakthi</p></div><div><br></div><br><br><div class="gmail_quote">On Thu, Mar 24, 2011 at 10:38 AM, sakthi selvam <span dir="ltr">&lt;<a href="mailto:sakthi.cdm@gmail.com">sakthi.cdm@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear All,<br>
<br>
Need your assistance:<br>
<br>
Currently I am using Wind River Linux distribution OS with kernel<br>
version 2.6.27.39 and Wind River version pne-3. After loading of my<br>
kernel module, I found it was permanent in the kernel using lsmod (for<br>
ex see below Ref 1). When I tried to remove, it was displaying as<br>
“ERROR: Removing &#39;hsl_module&#39;: Device or resource busy”. For your<br>
information, the same module is working fine with the Wind River pne-2<br>
Linux Distribution OS with kernel version 2.6.21.<br>
>From the kernel source, I came to know that only possibility of<br>
showing permanent is “if there is non-availability of cleanup_module<br>
and with the availability of init_module”.<br>
<br>
But in my case, cleanup module also available in memory, after loading<br>
the module. I used to check using the file in /proc/kallsyms for the<br>
availability of cleanup module in memory.<br>
<br>
Thanks for reading. Prompt reply is expected to identify the root cause.<br>
<br>
Ref 1:<br>
Module                  Size  Used by<br>
hsl_module            530454  0 [permanent]<br>
<br>
<br>
<br>
<br>
Thanks,<br>
<font color="#888888">Sakthi Selvam<br>
</font></blockquote></div><br>