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:16:28
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.
Oh, and the other bit to this is protecting the hardware against two
concurrent accesses if that's what's required.

Eg, 8250 having characters written to the 'transmit' register while
DLAB is set, thereby corrupting the divisor being programmed into it.
There's other UARTs which shouldn't have FIFOs loaded while the UART
is disabled across an update.

Can you guarantee without locks that writes to the UART registers by
the interrupt handler won't happen while the .set_termios is
reprogramming the UART?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help