Thread (86 messages) 86 messages, 20 authors, 2011-01-28

Locking in the clk API

From: Russell King - ARM Linux <hidden>
Date: 2011-01-27 21:12:26
Also in: linux-sh, lkml

On Thu, Jan 27, 2011 at 09:07:29PM +0000, Alan Cox wrote:
quoted
quoted
For internal tree purposes, does .set_termios need to be atomic? Can it  
grab mutexes instead of spinlock?
I think I already answered that question above where I said "protect
against the interrupt handler accessing the port->* stuff".
I'm not sure you answered it correctly however as the locking nowdays is
a bit different.

Architecturally the termios handling doesn't need a spin lock nor is it
called under one. In fact it's vital this is the case because of USB.
It needs to protect against the read_status_mask and ignore_status_mask
being read half-way through an update by the interrupt handler, otherwise
you can end up with god-knows-what coming through from each termios
change.

Eg, you could see an effective CREAD flip when the state of CREAD wasn't
actually changed.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help