Skip to contentSkip to conversation

Kernelnewbies Digest, Vol 37, Issue 37

DISCUSSION Frank Martinez 1 participant 1 message Dec 28, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

unsubscribe

Quoted 65 lines · On Sat, Dec 28, 2013 at 12:00 PM, <[email protected]>wrot…

Send Kernelnewbies mailing list submissions to
kernelnewbies at kernelnewbies.org

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
or, via email, send a message with subject or body 'help' to
kernelnewbies-request at kernelnewbies.org

You can reach the person managing the list at
kernelnewbies-owner at kernelnewbies.org

When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..."

Today's Topics:

1. Re: Can't cleanly unload driver (Valdis.Kletnieks at vt.edu)

----------------------------------------------------------------------

Message: 1
Date: Sat, 28 Dec 2013 00:13:08 -0500
From: Valdis.Kletnieks at vt.edu
Subject: Re: Can't cleanly unload driver
To: Eric Fowler <[email protected]>
Cc: kernelnewbies at kernelnewbies.org
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Quoted 10 lines · Eric Fowler

I suspect I am doing something wrong in the code with register/unregister_chrdev(), but I have been over that code a million times. It looks fine.

Now:
insmod the device, OK
rmmod the device, OK
Check /proc/devices , device # is present
insmod the device again, fails with ERROR: could not insert module ./foobar.ko: Device or resource busy

It does smell like an unregister issue. You may want to try adding printk() calls to print out the return code from register and unregister. I'm willing to bet that (a) the unegister is failing because somebody still has a reference on the device, and (b) the second register call fails because the device already exists, causing your module_init() to bail out.

The fun is that you may not have taken a reference on the device directly yourself - you may have called some other get_foo() that ends up taking an implicit reference under the covers, causing issues when you fail to call put_foo() at the right place...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url :
http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131228/292e4d34/attachment-0001.bin

------------------------------

Quoted 9 lines

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

End of Kernelnewbies Digest, Vol 37, Issue 37
*********************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20131228/d7a09856/attachment.html