Thread (18 messages) 18 messages, 3 authors, 2011-03-17

Re: [PATCH] NFC: Driver for Inside Secure MicroRead NFC chip

From: Arnd Bergmann <hidden>
Date: 2011-03-17 13:54:47
Also in: lkml

On Thursday 17 March 2011, Waldemar.Rymarkiewicz-++hxYGjEMp0AvxtiuMwx3w@public.gmane.org wrote:
quoted
This is not very different from opening the file descriptor in 
multiple processes, which you prevent using your logic.
but in the case when two independent applications try to open 
my device I can't let the second to access. They obviously won't
synch the access.
My point was that you don't need to worry.
 
quoted
You can of course argue that you try your best to prevent the 
race. Traditionally, e.g. on serial ports and the like, we 
don't do this but instead rely on user space synchronizing the 
access. What you have to make sure of course is that multiple 
threads calling read on the same file can never bring the 
kernel driver into an invalid state.
I assume, if an application shares the file pointer deliberately
it have to sync the access. In other cases, the driver needs to
secure it.
As I said, it's not important if you do it and it certainly doesn't
cause harm to prevent multiple open. It's just that generally
we don't care too much about this problem.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help