All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tero Kristo <t-kristo@ti.com>
To: Nishanth Menon <nm@ti.com>, <linux-omap@vger.kernel.org>,
	<linux-clk@vger.kernel.org>, <sboyd@codeaurora.org>,
	<mturquette@baylibre.com>, <tony@atomide.com>
Cc: <linux-arm-kernel@lists.infradead.org>
Subject: Re: [RESEND PATCHv2 08/28] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs
Date: Tue, 14 Jun 2016 09:31:14 +0300	[thread overview]
Message-ID: <575FA4B2.70408@ti.com> (raw)
In-Reply-To: <575F4257.3010108@ti.com>

On 14/06/16 02:31, Nishanth Menon wrote:
> On 06/13/2016 02:04 PM, Tero Kristo wrote:
> [..]
>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c
> b/arch/arm/mach-omap2/omap_hwmod.c
>> index 0c85f91..635a563 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>
> [...]
>
>> @@ -2177,14 +2173,10 @@ static int _enable(struct omap_hwmod *oh)
>>
>>   	r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) :
>>   		-EINVAL;
>> -	if (!r) {
>> -		/*
>> -		 * Set the clockdomain to HW_AUTO only if the target is ready,
>> -		 * assuming that the previous state was HW_AUTO
>> -		 */
>> -		if (oh->clkdm && hwsup)
>> -			clkdm_allow_idle(oh->clkdm);
>> +	if (oh->clkdm)
>> +		clkdm_allow_idle(oh->clkdm);
>
> Should'nt this be under if (!r) ?

No, we must call clkdm_allow_idle() always, otherwise the clockdomain is 
left in force wakeup state for all eternity, which is wrong, and 
prevents any further transitions on the clockdomain. (Most likely the 
failed transition on the hwmod itself is going to prevent idle on the 
clockdomain though, but its better to keep at least the clockdomain 
state sane.)

-Tero

WARNING: multiple messages have this Message-ID (diff)
From: Tero Kristo <t-kristo@ti.com>
To: Nishanth Menon <nm@ti.com>,
	linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
	sboyd@codeaurora.org, mturquette@baylibre.com, tony@atomide.com
Cc: linux-arm-kernel@lists.infradead.org
Subject: Re: [RESEND PATCHv2 08/28] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs
Date: Tue, 14 Jun 2016 09:31:14 +0300	[thread overview]
Message-ID: <575FA4B2.70408@ti.com> (raw)
In-Reply-To: <575F4257.3010108@ti.com>

On 14/06/16 02:31, Nishanth Menon wrote:
> On 06/13/2016 02:04 PM, Tero Kristo wrote:
> [..]
>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c
> b/arch/arm/mach-omap2/omap_hwmod.c
>> index 0c85f91..635a563 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>
> [...]
>
>> @@ -2177,14 +2173,10 @@ static int _enable(struct omap_hwmod *oh)
>>
>>   	r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) :
>>   		-EINVAL;
>> -	if (!r) {
>> -		/*
>> -		 * Set the clockdomain to HW_AUTO only if the target is ready,
>> -		 * assuming that the previous state was HW_AUTO
>> -		 */
>> -		if (oh->clkdm && hwsup)
>> -			clkdm_allow_idle(oh->clkdm);
>> +	if (oh->clkdm)
>> +		clkdm_allow_idle(oh->clkdm);
>
> Should'nt this be under if (!r) ?

No, we must call clkdm_allow_idle() always, otherwise the clockdomain is 
left in force wakeup state for all eternity, which is wrong, and 
prevents any further transitions on the clockdomain. (Most likely the 
failed transition on the hwmod itself is going to prevent idle on the 
clockdomain though, but its better to keep at least the clockdomain 
state sane.)

-Tero


WARNING: multiple messages have this Message-ID (diff)
From: t-kristo@ti.com (Tero Kristo)
To: linux-arm-kernel@lists.infradead.org
Subject: [RESEND PATCHv2 08/28] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs
Date: Tue, 14 Jun 2016 09:31:14 +0300	[thread overview]
Message-ID: <575FA4B2.70408@ti.com> (raw)
In-Reply-To: <575F4257.3010108@ti.com>

On 14/06/16 02:31, Nishanth Menon wrote:
> On 06/13/2016 02:04 PM, Tero Kristo wrote:
> [..]
>> diff --git a/arch/arm/mach-omap2/omap_hwmod.c
> b/arch/arm/mach-omap2/omap_hwmod.c
>> index 0c85f91..635a563 100644
>> --- a/arch/arm/mach-omap2/omap_hwmod.c
>> +++ b/arch/arm/mach-omap2/omap_hwmod.c
>
> [...]
>
>> @@ -2177,14 +2173,10 @@ static int _enable(struct omap_hwmod *oh)
>>
>>   	r = (soc_ops.wait_target_ready) ? soc_ops.wait_target_ready(oh) :
>>   		-EINVAL;
>> -	if (!r) {
>> -		/*
>> -		 * Set the clockdomain to HW_AUTO only if the target is ready,
>> -		 * assuming that the previous state was HW_AUTO
>> -		 */
>> -		if (oh->clkdm && hwsup)
>> -			clkdm_allow_idle(oh->clkdm);
>> +	if (oh->clkdm)
>> +		clkdm_allow_idle(oh->clkdm);
>
> Should'nt this be under if (!r) ?

No, we must call clkdm_allow_idle() always, otherwise the clockdomain is 
left in force wakeup state for all eternity, which is wrong, and 
prevents any further transitions on the clockdomain. (Most likely the 
failed transition on the hwmod itself is going to prevent idle on the 
clockdomain though, but its better to keep at least the clockdomain 
state sane.)

-Tero

  reply	other threads:[~2016-06-14  6:31 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 19:04 [RESEND PATCHv2 00/28] clk: ti: hwmod clock type support Tero Kristo
2016-06-13 19:04 ` Tero Kristo
2016-06-13 19:04 ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 01/28] clk: ti: add ti_clk_get helper API Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-28  6:47   ` Tony Lindgren
2016-06-28  6:47     ` Tony Lindgren
2016-06-29  6:17     ` Tero Kristo
2016-06-29  6:17       ` Tero Kristo
2016-06-29  6:17       ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 02/28] clk: ti: dpll: use ti_clk_get to fetch ref/bypass clocks Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 03/28] ARM: OMAP2+: omap_device: create clock alias purely from DT data Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-28  7:00   ` Tony Lindgren
2016-06-28  7:00     ` Tony Lindgren
2016-06-29  7:08     ` Tero Kristo
2016-06-29  7:08       ` Tero Kristo
2016-06-29  7:08       ` Tero Kristo
2016-06-29  7:10       ` Tero Kristo
2016-06-29  7:10         ` Tero Kristo
2016-06-29  7:10         ` Tero Kristo
2016-06-29  7:54         ` Tony Lindgren
2016-06-29  7:54           ` Tony Lindgren
2016-06-29  9:00           ` Tero Kristo
2016-06-29  9:00             ` Tero Kristo
2016-06-29  9:00             ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 04/28] ARM: OMAP2+: hwmod: use new ti_clk_get API to search for clock handles Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-28  6:57   ` Tony Lindgren
2016-06-28  6:57     ` Tony Lindgren
2016-06-29  6:16     ` Tero Kristo
2016-06-29  6:16       ` Tero Kristo
2016-06-29  6:16       ` Tero Kristo
2016-06-29  7:01       ` Tony Lindgren
2016-06-29  7:01         ` Tony Lindgren
2016-06-13 19:04 ` [RESEND PATCHv2 05/28] ARM: OMAP2+: clock: use the new ti_clk_get for fetching clocks Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 06/28] ARM: OMAP2+: hwmod: fetch main_clk based on hwmod name Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-28  7:03   ` Tony Lindgren
2016-06-28  7:03     ` Tony Lindgren
2016-06-13 19:04 ` [RESEND PATCHv2 07/28] ARM: OMAP2+: timer: change order of hwmod data handling Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-28  7:04   ` Tony Lindgren
2016-06-28  7:04     ` Tony Lindgren
2016-06-13 19:04 ` [RESEND PATCHv2 08/28] ARM: OMAP2+: clockdomain: add usecounting support to autoidle APIs Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 23:31   ` Nishanth Menon
2016-06-13 23:31     ` Nishanth Menon
2016-06-13 23:31     ` Nishanth Menon
2016-06-14  6:31     ` Tero Kristo [this message]
2016-06-14  6:31       ` Tero Kristo
2016-06-14  6:31       ` Tero Kristo
2016-06-28  7:06   ` Tony Lindgren
2016-06-28  7:06     ` Tony Lindgren
2016-06-13 19:04 ` [RESEND PATCHv2 09/28] ARM: AM33xx: fix module_wait_ready without clkctrl register Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-28  7:08   ` Tony Lindgren
2016-06-28  7:08     ` Tony Lindgren
2016-06-13 19:04 ` [RESEND PATCHv2 10/28] clk: ti: omap2: transition to usage of ti_clk_get Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 11/28] clk: ti: am33xx: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 12/28] clk: ti: omap3: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 13/28] clk: ti: am43xx: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 14/28] clk: ti: omap4: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 15/28] clk: ti: omap5: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 16/28] clk: ti: dra7: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 17/28] clk: ti: dm814x: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 18/28] clk: ti: dm816x: cleanup any unnecessary clock aliases Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 19/28] clk: ti: remove un-used definitions from public clk_hw_omap struct Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 20/28] clk: ti: mux: export mux clock APIs locally Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 21/28] clk: ti: am33xx: fix timer3/6 init time setup for module clocks Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 22/28] dt-bindings: clk: ti: Document module clock type Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 23/28] clk: ti: add support for omap4 module clocks Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 24/28] ARM: dts: omap4: add hwmod " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04 ` [RESEND PATCHv2 25/28] ARM: dts: am33xx: " Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:04   ` Tero Kristo
2016-06-13 19:05 ` [RESEND PATCHv2 26/28] ARM: dts: am43xx: " Tero Kristo
2016-06-13 19:05   ` Tero Kristo
2016-06-13 19:05   ` Tero Kristo
2016-06-13 19:05 ` [RESEND PATCHv2 27/28] ARM: dts: omap5: " Tero Kristo
2016-06-13 19:05   ` Tero Kristo
2016-06-13 19:05   ` Tero Kristo
2016-06-13 19:05 ` [RESEND PATCHv2 28/28] ARM: dts: dra7: " Tero Kristo
2016-06-13 19:05   ` Tero Kristo
2016-06-13 19:05   ` Tero Kristo
2016-06-20 12:10 ` [RESEND PATCHv2 00/28] clk: ti: hwmod clock type support Tony Lindgren
2016-06-20 12:10   ` Tony Lindgren
2016-06-20 12:10   ` Tony Lindgren

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=575FA4B2.70408@ti.com \
    --to=t-kristo@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nm@ti.com \
    --cc=sboyd@codeaurora.org \
    --cc=tony@atomide.com \
    /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.