From: Rajendra Nayak <rnayak@ti.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 05/11] OMAPDSS: add clk_prepare and clk_unprepare
Date: Wed, 27 Jun 2012 05:31:24 +0000 [thread overview]
Message-ID: <4FEA97DC.4070902@ti.com> (raw)
In-Reply-To: <1340770798.1972.4.camel@lappyti>
On Wednesday 27 June 2012 09:49 AM, Tomi Valkeinen wrote:
> On Tue, 2012-06-26 at 17:47 -0700, Mike Turquette wrote:
>> On 20120625-16:14, Tomi Valkeinen wrote:
>>> A question about clk_prepare/unprepare, not directly related: let's say
>>> I have a driver for some HW block. The driver doesn't use clk functions,
>>> but uses runtime PM. The driver also sets pm_runtime_irq_safe().
>>>
>>> Now, the driver can call pm_runtime_get_sync() in an atomic context, and
>>> this would lead to the underlying framework (hwmod, omap_device, I don't
>>> know who =) enabling the func clock for that HW. But this would happen
>>> in atomic context, so the underlying framework can't use clk_prepare.
>>>
>>> How does the underlying framework handle that case? (sorry if that's a
>>> stupid question =).
>>>
>>
>> I think it's a good question!
>>
>> If we're going to call clk_prepare_enable from within a runtime pm
>> callback then I think we'll need to check if _irq_safe() is set and
>> conditionally call only clk_enable in such a case.
>>
>> I'm not a runtime pm expert, but if the driver owns the responsibility
>> of calling pm_runtime_irq_safe then the driver has the proper context
>> to know that it should call clk_prepare BEFORE calling
>> pm_runtime_get_sync.
>
> That's not quite what I meant. If it's the driver that does clk_enable,
> be it in runtime PM callback or not, it's driver's responsibility.
>
> But some clocks are not handled by the driver, but the hwmod/omap_device
> framework. Mainly I think this is for the functional and interface
> clocks. The driver has no visibility to those, they are implicitly
> enabled via pm_runtime_get.
yes, thats the tricky part on how would hwmod/omap_device know if the
driver would use runtime pm within atomic context or non-atomic context.
The driver does inform the runtime pm framework about this by calling a
pm_runtime_irq_safe(), which is then used to set the .irq_safe flag
telling it to leave the interrupts disabled during callbacks.
This information however does not flow down to hwmod/omap_device in any
way. So the way its currently handled is to do an early prepare of all
hwmod controlled clocks.
I have copied Kevin in case he has any better ideas on how this should
be handled.
>
> Tomi
>
WARNING: multiple messages have this Message-ID (diff)
From: Rajendra Nayak <rnayak@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Mike Turquette <mturquette@ti.com>,
paul@pwsan.com, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-fbdev@vger.kernel.org, "Hilman, Kevin" <khilman@ti.com>
Subject: Re: [PATCH 05/11] OMAPDSS: add clk_prepare and clk_unprepare
Date: Wed, 27 Jun 2012 10:49:24 +0530 [thread overview]
Message-ID: <4FEA97DC.4070902@ti.com> (raw)
In-Reply-To: <1340770798.1972.4.camel@lappyti>
On Wednesday 27 June 2012 09:49 AM, Tomi Valkeinen wrote:
> On Tue, 2012-06-26 at 17:47 -0700, Mike Turquette wrote:
>> On 20120625-16:14, Tomi Valkeinen wrote:
>>> A question about clk_prepare/unprepare, not directly related: let's say
>>> I have a driver for some HW block. The driver doesn't use clk functions,
>>> but uses runtime PM. The driver also sets pm_runtime_irq_safe().
>>>
>>> Now, the driver can call pm_runtime_get_sync() in an atomic context, and
>>> this would lead to the underlying framework (hwmod, omap_device, I don't
>>> know who =) enabling the func clock for that HW. But this would happen
>>> in atomic context, so the underlying framework can't use clk_prepare.
>>>
>>> How does the underlying framework handle that case? (sorry if that's a
>>> stupid question =).
>>>
>>
>> I think it's a good question!
>>
>> If we're going to call clk_prepare_enable from within a runtime pm
>> callback then I think we'll need to check if _irq_safe() is set and
>> conditionally call only clk_enable in such a case.
>>
>> I'm not a runtime pm expert, but if the driver owns the responsibility
>> of calling pm_runtime_irq_safe then the driver has the proper context
>> to know that it should call clk_prepare BEFORE calling
>> pm_runtime_get_sync.
>
> That's not quite what I meant. If it's the driver that does clk_enable,
> be it in runtime PM callback or not, it's driver's responsibility.
>
> But some clocks are not handled by the driver, but the hwmod/omap_device
> framework. Mainly I think this is for the functional and interface
> clocks. The driver has no visibility to those, they are implicitly
> enabled via pm_runtime_get.
yes, thats the tricky part on how would hwmod/omap_device know if the
driver would use runtime pm within atomic context or non-atomic context.
The driver does inform the runtime pm framework about this by calling a
pm_runtime_irq_safe(), which is then used to set the .irq_safe flag
telling it to leave the interrupts disabled during callbacks.
This information however does not flow down to hwmod/omap_device in any
way. So the way its currently handled is to do an early prepare of all
hwmod controlled clocks.
I have copied Kevin in case he has any better ideas on how this should
be handled.
>
> Tomi
>
WARNING: multiple messages have this Message-ID (diff)
From: rnayak@ti.com (Rajendra Nayak)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 05/11] OMAPDSS: add clk_prepare and clk_unprepare
Date: Wed, 27 Jun 2012 10:49:24 +0530 [thread overview]
Message-ID: <4FEA97DC.4070902@ti.com> (raw)
In-Reply-To: <1340770798.1972.4.camel@lappyti>
On Wednesday 27 June 2012 09:49 AM, Tomi Valkeinen wrote:
> On Tue, 2012-06-26 at 17:47 -0700, Mike Turquette wrote:
>> On 20120625-16:14, Tomi Valkeinen wrote:
>>> A question about clk_prepare/unprepare, not directly related: let's say
>>> I have a driver for some HW block. The driver doesn't use clk functions,
>>> but uses runtime PM. The driver also sets pm_runtime_irq_safe().
>>>
>>> Now, the driver can call pm_runtime_get_sync() in an atomic context, and
>>> this would lead to the underlying framework (hwmod, omap_device, I don't
>>> know who =) enabling the func clock for that HW. But this would happen
>>> in atomic context, so the underlying framework can't use clk_prepare.
>>>
>>> How does the underlying framework handle that case? (sorry if that's a
>>> stupid question =).
>>>
>>
>> I think it's a good question!
>>
>> If we're going to call clk_prepare_enable from within a runtime pm
>> callback then I think we'll need to check if _irq_safe() is set and
>> conditionally call only clk_enable in such a case.
>>
>> I'm not a runtime pm expert, but if the driver owns the responsibility
>> of calling pm_runtime_irq_safe then the driver has the proper context
>> to know that it should call clk_prepare BEFORE calling
>> pm_runtime_get_sync.
>
> That's not quite what I meant. If it's the driver that does clk_enable,
> be it in runtime PM callback or not, it's driver's responsibility.
>
> But some clocks are not handled by the driver, but the hwmod/omap_device
> framework. Mainly I think this is for the functional and interface
> clocks. The driver has no visibility to those, they are implicitly
> enabled via pm_runtime_get.
yes, thats the tricky part on how would hwmod/omap_device know if the
driver would use runtime pm within atomic context or non-atomic context.
The driver does inform the runtime pm framework about this by calling a
pm_runtime_irq_safe(), which is then used to set the .irq_safe flag
telling it to leave the interrupts disabled during callbacks.
This information however does not flow down to hwmod/omap_device in any
way. So the way its currently handled is to do an early prepare of all
hwmod controlled clocks.
I have copied Kevin in case he has any better ideas on how this should
be handled.
>
> Tomi
>
next prev parent reply other threads:[~2012-06-27 5:31 UTC|newest]
Thread overview: 119+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 13:47 [PATCH 00/11] Prepare for OMAP2+ movement to Common Clk Rajendra Nayak
2012-06-22 13:47 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 01/11] ARM: omap: clk: add clk_prepare and clk_unprepare Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 17:42 ` Pankaj Jangra
2012-06-22 17:42 ` Pankaj Jangra
2012-06-25 5:36 ` Rajendra Nayak
2012-06-25 5:36 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 02/11] mmc: omap: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 18:23 ` S, Venkatraman
2012-06-22 18:23 ` S, Venkatraman
2012-06-22 18:34 ` Paul Walmsley
2012-06-22 18:34 ` Paul Walmsley
2012-06-25 5:25 ` Rajendra Nayak
2012-06-25 5:25 ` Rajendra Nayak
2012-06-25 6:18 ` Paul Walmsley
2012-06-25 6:18 ` Paul Walmsley
2012-06-25 7:13 ` Rajendra Nayak
2012-06-25 7:13 ` Rajendra Nayak
2012-06-25 5:32 ` Rajendra Nayak
2012-06-25 5:32 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 03/11] hwrng: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 04/11] mfd: omap-usb: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 19:04 ` Paul Walmsley
2012-06-22 19:04 ` Paul Walmsley
2012-06-25 8:55 ` Munegowda, Keshava
2012-06-25 8:55 ` Munegowda, Keshava
2012-06-22 13:48 ` [PATCH 05/11] OMAPDSS: " Rajendra Nayak
2012-06-22 13:51 ` Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-25 6:07 ` Tomi Valkeinen
2012-06-25 6:07 ` Tomi Valkeinen
2012-06-25 6:07 ` Tomi Valkeinen
2012-06-25 6:59 ` Rajendra Nayak
2012-06-25 7:11 ` Rajendra Nayak
2012-06-25 6:59 ` Rajendra Nayak
2012-06-25 7:58 ` Tomi Valkeinen
2012-06-25 7:58 ` Tomi Valkeinen
2012-06-25 7:58 ` Tomi Valkeinen
2012-06-25 11:48 ` Rajendra Nayak
2012-06-25 11:52 ` Rajendra Nayak
2012-06-25 11:48 ` Rajendra Nayak
2012-06-25 13:14 ` Tomi Valkeinen
2012-06-25 13:14 ` Tomi Valkeinen
2012-06-25 13:14 ` Tomi Valkeinen
2012-06-26 5:00 ` Rajendra Nayak
2012-06-26 5:12 ` Rajendra Nayak
2012-06-26 5:00 ` Rajendra Nayak
2012-06-26 6:55 ` Tomi Valkeinen
2012-06-26 6:55 ` Tomi Valkeinen
2012-06-26 6:55 ` Tomi Valkeinen
2012-06-26 7:36 ` Rajendra Nayak
2012-06-26 7:48 ` Rajendra Nayak
2012-06-26 7:36 ` Rajendra Nayak
2012-06-27 0:47 ` Mike Turquette
2012-06-27 0:47 ` Mike Turquette
2012-06-27 0:47 ` Mike Turquette
2012-06-27 4:19 ` Tomi Valkeinen
2012-06-27 4:19 ` Tomi Valkeinen
2012-06-27 4:19 ` Tomi Valkeinen
2012-06-27 5:19 ` Rajendra Nayak [this message]
2012-06-27 5:31 ` Rajendra Nayak
2012-06-27 5:19 ` Rajendra Nayak
2012-06-25 11:22 ` Russell King - ARM Linux
2012-06-25 11:22 ` Russell King - ARM Linux
2012-06-25 11:22 ` Russell King - ARM Linux
2012-06-22 13:48 ` [PATCH 06/11] gpio/omap: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 15:57 ` Pankaj Jangra
2012-06-22 15:57 ` Pankaj Jangra
2012-06-22 19:17 ` Paul Walmsley
2012-06-22 19:17 ` Paul Walmsley
2012-06-25 5:30 ` Rajendra Nayak
2012-06-25 5:30 ` Rajendra Nayak
2012-06-25 6:11 ` DebBarma, Tarun Kanti
2012-06-25 6:11 ` DebBarma, Tarun Kanti
2012-06-25 7:02 ` Rajendra Nayak
2012-06-25 7:02 ` Rajendra Nayak
2012-06-25 10:22 ` DebBarma, Tarun Kanti
2012-06-25 10:22 ` DebBarma, Tarun Kanti
2012-06-22 13:48 ` [PATCH 07/11] w1: omap_hdq: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 18:35 ` Paul Walmsley
2012-06-22 18:35 ` Paul Walmsley
2012-06-25 5:25 ` Rajendra Nayak
2012-06-25 5:25 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 08/11] crypto: omap: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 18:58 ` Paul Walmsley
2012-06-22 18:58 ` Paul Walmsley
2012-06-25 5:29 ` Rajendra Nayak
2012-06-25 5:29 ` Rajendra Nayak
2012-06-26 10:39 ` Paul Walmsley
2012-06-26 10:39 ` Paul Walmsley
2012-06-26 10:58 ` Rajendra Nayak
2012-06-26 10:58 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 09/11] iommu: " Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 10/11] ARM: omap: hwmod: get rid of all omap_clk_get_by_name usage Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-22 13:48 ` [PATCH 11/11] ARM: omap: clk: Remove all direct dereferencing of struct clk Rajendra Nayak
2012-06-22 13:48 ` Rajendra Nayak
2012-06-27 12:50 ` [PATCH 00/11] Prepare for OMAP2+ movement to Common Clk Laurent Pinchart
2012-06-27 12:50 ` Laurent Pinchart
2012-06-27 16:36 ` Paul Walmsley
2012-06-27 16:36 ` Paul Walmsley
2012-06-27 18:05 ` Laurent Pinchart
2012-06-27 18:05 ` Laurent Pinchart
2012-06-27 18:45 ` Laurent Pinchart
2012-06-27 18:45 ` Laurent Pinchart
2012-06-27 19:56 ` Laurent Pinchart
2012-06-27 19:56 ` Laurent Pinchart
2012-06-27 19:59 ` Paul Walmsley
2012-06-27 19:59 ` Paul Walmsley
2012-06-27 20:25 ` Laurent Pinchart
2012-06-27 20:25 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FEA97DC.4070902@ti.com \
--to=rnayak@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.