lkml.org 
[lkml]   [2011]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Locking in the clk API
On 01/27/2011 12:54 AM, Russell King - ARM Linux wrote:
> On Wed, Jan 26, 2011 at 08:34:20PM -0800, Saravana Kannan wrote:
>> I'm not too familiar with serial/tty, does anyone know if the
>> .set_termios needs to be atmoic? If not, we could just change
>> cpm_uart/cpm_uart_core.c to use mutex instead of spinlock.
>
> The locking is there to protect against the interrupt handler accessing
> the port->* stuff (which seems to have been forgotten by the cpm driver).
>
> I don't see any reason why clk_set_rate() needs to be under the spinlock
> there - we need the reprogramming of the baud rate within the spinlock
> on 8250 because of DLAB bit hiding the data registers. It's also a good
> idea that it _is_ within the spinlock along with uart_update_timeout()
> to ensure timeouts and the baud rate are updated together.

For internal tree purposes, does .set_termios need to be atomic? Can it
grab mutexes instead of spinlock?

Going back to the topic, how about CPU freq drivers possibly using
clk_set_rate() to change freq? Do you think that's not the case or a
concern?

All,

Do any one of your mach's control CPU freq using clk_set_rate() and does
it need to be atomic? CPUfreq doesn't need it to be atomic. So, you will
need clk_set_rate() to be atomic only if you try to use it to lower CPU
freq very late during idle/suspend.

-Saravana

--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.


\
 
 \ /
  Last update: 2011-01-27 21:33    [W:0.176 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site