public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Eric Piel <Eric.Piel@tremplin-utc.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: O2micro smartcard reader driver.
Date: Tue, 12 Dec 2006 23:05:53 +0100	[thread overview]
Message-ID: <200612122305.53767.oliver@neukum.org> (raw)
In-Reply-To: <457F1F0F.20109@tremplin-utc.net>

Am Dienstag, 12. Dezember 2006 22:28 schrieb Eric Piel:

Hi

> Thanks a lot for reading my code, I didn't even hope that someone would! 
> I've corrected the copy_to_user (and copy_from_user) code. However I 
> don't know how to do locking for the concurrent ioctls. Indeed, I don't 
> think there is anything preventing two programs to call the driver at 
> the same time. Unfortunately, I've got no idea how to do the locking and 
> surprisingly couldn't find any ioctl code in the kernel doing locking. 
> Maybe I've just not looked at the right place, could you give a me some 
> hint how to do locking for ioctl's ?

I take it back. Reading your code again, it seems to me that it'll
never sleep. In this case you are protected by BKL. If not, you need
to use mutexes, just like eg. in drivers/usb/class/usblp.c

	HTH
		Oliver

  reply	other threads:[~2006-12-12 22:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27 17:28 O2micro smartcard reader driver Laurent Bigonville
2006-11-28 10:13 ` Eric Piel
2006-11-28 11:49   ` Oliver Neukum
2006-12-12 21:28     ` Eric Piel
2006-12-12 22:05       ` Oliver Neukum [this message]
2007-02-16 23:36       ` Markus Rechberger
2007-02-17  3:55         ` Markus Rechberger
2007-02-19 11:04           ` Éric Piel
2006-11-28 12:19 ` Andreas Jellinghaus
2006-11-28 20:50   ` Laurent Bigonville
  -- strict thread matches above, loose matches on Subject: below --
2007-02-19 12:15 Markus Rechberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200612122305.53767.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=Eric.Piel@tremplin-utc.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox