<div dir="ltr">unsubscribe</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Dec 28, 2013 at 12:00 PM, <span dir="ltr"><<a href="mailto:kernelnewbies-request@kernelnewbies.org" target="_blank">kernelnewbies-request@kernelnewbies.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Send Kernelnewbies mailing list submissions to<br>
<a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:kernelnewbies-request@kernelnewbies.org">kernelnewbies-request@kernelnewbies.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:kernelnewbies-owner@kernelnewbies.org">kernelnewbies-owner@kernelnewbies.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Kernelnewbies digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Can't cleanly unload driver (<a href="mailto:Valdis.Kletnieks@vt.edu">Valdis.Kletnieks@vt.edu</a>)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Sat, 28 Dec 2013 00:13:08 -0500<br>
From: <a href="mailto:Valdis.Kletnieks@vt.edu">Valdis.Kletnieks@vt.edu</a><br>
Subject: Re: Can't cleanly unload driver<br>
To: Eric Fowler <<a href="mailto:eric.fowler@gmail.com">eric.fowler@gmail.com</a>><br>
Cc: <a href="mailto:kernelnewbies@kernelnewbies.org">kernelnewbies@kernelnewbies.org</a><br>
Message-ID: <<a href="mailto:221197.1388207588@turing-police.cc.vt.edu">221197.1388207588@turing-police.cc.vt.edu</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>
On Fri, 27 Dec 2013 19:33:50 -0800, Eric Fowler said:<br>
<br>
> I suspect I am doing something wrong in the code with<br>
> register/unregister_chrdev(), but I have been over that code a million<br>
> times. It looks fine.<br>
><br>
> Now:<br>
> insmod the device, OK<br>
> rmmod the device, OK<br>
> Check /proc/devices , device # is present<br>
> insmod the device again, fails with ERROR: could not insert module<br>
> ./foobar.ko: Device or resource busy<br>
<br>
It does smell like an unregister issue. You may want to try adding<br>
printk() calls to print out the return code from register and unregister.<br>
I'm willing to bet that (a) the unegister is failing because somebody<br>
still has a reference on the device, and (b) the second register call fails<br>
because the device already exists, causing your module_init() to bail out.<br>
<br>
The fun is that you may not have taken a reference on the device directly<br>
yourself - you may have called some other get_foo() that ends up taking an<br>
implicit reference under the covers, causing issues when you fail to call<br>
put_foo() at the right place...<br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: not available<br>
Type: application/pgp-signature<br>
Size: 848 bytes<br>
Desc: not available<br>
Url : <a href="http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131228/292e4d34/attachment-0001.bin" target="_blank">http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131228/292e4d34/attachment-0001.bin</a><br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br>
<br>
End of Kernelnewbies Digest, Vol 37, Issue 37<br>
*********************************************<br>
</blockquote></div><br></div>