kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Locking IOCTL
@ 2011-11-15  7:22 Praveen kumar
  2011-11-15  7:58 ` Dave Hylands
  0 siblings, 1 reply; 7+ messages in thread
From: Praveen kumar @ 2011-11-15  7:22 UTC (permalink / raw)
  To: kernelnewbies

 Hi All,
I have a situation where I have to lock the ioctl provided in my driver. I
have a uni processor (ARM) system.
I am using Mutex as the lock for my ioctl.
DEFINE_MUTEX(&lock_ioctl);
MyIoctl()
{
Mutex_lock(&lock_ioctl);
Switch(){
...........
}
Mutex_unlock(&lock_ioctl);
return 0;
}
I just wanted to know am I using the best lock available for the situation
aor do I have any flaw in my implementation???

And from LKD I  read that "*lock the data not the code*" and which I am
literally doing so ?? any comments on this ?

I have interrupts in my driver which is nothing to do with the lock.I am
taking care that where ever I return in my ioctl the lock is released.

Thanks ,
Praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20111115/cfaeae49/attachment.html 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-24 22:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-15  7:22 Locking IOCTL Praveen kumar
2011-11-15  7:58 ` Dave Hylands
2011-11-15 12:23   ` Praveen kumar
2011-11-15 16:37     ` Tirtha Ghosh
2011-11-19 12:34       ` Scull -unable to handle kernel paging request anish kumar
2011-11-24 22:21         ` Javier Martinez Canillas
2011-11-15 21:34     ` Locking IOCTL Dave Hylands

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).