[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D3907BD.4040900@codeaurora.org>
Date: Thu, 20 Jan 2011 20:12:45 -0800
From: Saravana Kannan <skannan@...eaurora.org>
To: Dima Zavin <dmitriyz@...gle.com>
CC: Nicolas Pitre <nicolas.pitre@...aro.org>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Russell King - ARM Linux <linux@....linux.org.uk>,
linux-sh@...r.kernel.org,
Ben Herrenschmidt <benh@...nel.crashing.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
linux-kernel@...r.kernel.org, Paul Mundt <lethal@...ux-sh.org>,
Ben Dooks <ben-linux@...ff.org>,
Uwe Kleine-K??nig <u.kleine-koenig@...gutronix.de>,
Vincent Guittot <vincent.guittot@...aro.org>,
Jeremy Kerr <jeremy.kerr@...onical.com>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: Locking in the clk API
On 01/20/2011 06:06 PM, Dima Zavin wrote:
> On Thu, Jan 20, 2011 at 1:30 PM, Nicolas Pitre<nicolas.pitre@...aro.org> wrote:
>> On Thu, 20 Jan 2011, Russell King - ARM Linux wrote:
>>
>>> On Thu, Jan 20, 2011 at 04:29:15PM +0000, Ben Dooks wrote:
>>>> I really don't like the fact that people are doing these things in
>>>> atomic contexts, and I think we should apply some pressure to move
>>>> the atomic caller cases to use systems where they can sleep such as
>>>> using threaded-irq handlers (they work very nicely)
>>>
>>> How do you ensure that printk is always called from a non-atomic
>>> context?
>>
>> Is this a good example? I don't think that power sensitive systems such
>> as a cellphone should keep printk() enabled in the final product. The
>> output from printk() over a serial port is a debugging convenience, and
>> trying to aggressively turn on/off the serial clock around each call to
>> printk() is a bit silly. Better simply turn the serial clock on
>> whenever its console facility is opened, and turn it off when the
>> console is closed, which should be good enough in that context.
[fixing top post]
> Here's a better one.
>
> Many devices use serial display panels sitting on either MDDI or MIPI
> links. The interface clocks need to be on, but they stay in low-power
> mode while the display is on. The display controller however does not
> need to be on since the serial panels typically have a local
> framebuffer that does the idle panel refresh on it's own. When a new
> frame comes in to be displayed, you need to clock on the display
> controller, DMA the data to the panel, and when it's done turn the
> controller off. The clk_enable may or may not happen at irq context,
> depending on whether or not you are starting the DMA from a
> vsync/tear-effect irq or simply from the screen_update() function. The
> clk_disable will most certainly happen from the DMA_DONE irq.
Why do we need to turn on the clock in the IRQ? Why not defer it to a
workqueue (or whatever is the method of the day to defer work from an
IRQ)? The advantage of doing the clk_enable in the IRQ should be
negligible compared to the time it takes to do the DMA.
In my opinion, the only major reason for needing atomic clk APIs was due
to device_ops->suspend being atomic. Since that's not the case anymore,
I really don't see a justification for atomic clocks. Sure, I might have
missed some exceptions, but in that case we should make the atomic APIs
an exception (add clk_enable_atomic) and not the norm.
-Saravana
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists