All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shilimkar, Santosh" <santosh.shilimkar@ti.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	"Menon, Nishanth" <nm@ti.com>, Tony Lindgren <tony@atomide.com>,
	"Kristo, Tero" <t-kristo@ti.com>,
	"Paul Walmsley" <paul@pwsan.com>
Cc: "Kevin Hilman" <khilman@deeprootsystems.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"J, KEERTHY" <j-keerthy@ti.com>,
	"Benoît Cousson" <bcousson@baylibre.com>
Subject: RE: [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support
Date: Thu, 18 Sep 2014 00:42:48 +0000	[thread overview]
Message-ID: <448912EABC71F84BBCADFD3C67C4BE52CAC8B9@DBDE04.ent.ti.com> (raw)
In-Reply-To: <541A25DA.8030101@linaro.org>


________________________________________
From: Daniel Lezcano [daniel.lezcano@linaro.org]
Sent: Wednesday, September 17, 2014 8:22 PM
To: Shilimkar, Santosh; Menon, Nishanth; Tony Lindgren; Kristo, Tero; Paul Walmsley
Cc: Kevin Hilman; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org; J, KEERTHY; Benoît Cousson
Subject: Re: [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support

On 09/17/2014 04:20 PM, Shilimkar, Santosh wrote:
> Sorry for the format. Emailing from webmail.
> ________________________________________

[ ... ]


>> +     cx->mpu_state_vote++;
>> +     if (cx->mpu_state_vote == num_online_cpus()) {
>> +             pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
>> +             omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
>> +     }
>> +     raw_spin_unlock_irqrestore(&mpu_lock, flag);
>> +
>> +     omap4_enter_lowpower(dev->cpu, cx->cpu_state);
>> +
>> +     raw_spin_lock_irqsave(&mpu_lock, flag);
>> +     if (cx->mpu_state_vote == num_online_cpus())
>> +             omap_set_pwrdm_state(mpu_pd, PWRDM_POWER_ON);
>> +     cx->mpu_state_vote--;
>> +     raw_spin_unlock_irqrestore(&mpu_lock, flag);
>
> I am not sure that will work. What happens if a cpu exits idle and then
> re-enter idle immediately ?
>
> [Santosh] It works and that case is already taken care. CPU exist the idle and then votes
> out for cluster state and if it reenters with the right targeted state, the cluster state would
> be picked.

It isn't possible to have one cpu disabling the coherency, while the
other one is looking for a lock ? Or eg. cpu0 is on WFI then cpu1 is the
last entering idle. While cpu1 is entering 'lowpower', cpu0 exits the
wfi check the state vote and set the power domain on. In the meantime
cpu1 disables the coherency and cpu0 decrease the vote and release the
lock. Could be possible there is a very small racy window here ?

[Santosh] The coherency isn't disable by CPU. Thats actually taken care by
hardware. CPU takes it own power domain down and takes itself out of
coherency. The Coherency is always ON as long as there is a CPU ON
and SMP bit on that CPU is enabled.

The scenario, you mentioned can never happen on this hardware thanks
to the inbuilt smart hardware.

If you have more questions, lets discuss. I am around here at connect. ;-)

Regards,
Santosh

WARNING: multiple messages have this Message-ID (diff)
From: "Shilimkar, Santosh" <santosh.shilimkar@ti.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	"Menon, Nishanth" <nm@ti.com>, Tony Lindgren <tony@atomide.com>,
	"Kristo, Tero" <t-kristo@ti.com>, Paul Walmsley <paul@pwsan.com>
Cc: "Kevin Hilman" <khilman@deeprootsystems.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"J, KEERTHY" <j-keerthy@ti.com>,
	"Benoît Cousson" <bcousson@baylibre.com>
Subject: RE: [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support
Date: Thu, 18 Sep 2014 00:42:48 +0000	[thread overview]
Message-ID: <448912EABC71F84BBCADFD3C67C4BE52CAC8B9@DBDE04.ent.ti.com> (raw)
In-Reply-To: <541A25DA.8030101@linaro.org>


________________________________________
From: Daniel Lezcano [daniel.lezcano@linaro.org]
Sent: Wednesday, September 17, 2014 8:22 PM
To: Shilimkar, Santosh; Menon, Nishanth; Tony Lindgren; Kristo, Tero; Paul Walmsley
Cc: Kevin Hilman; linux-arm-kernel@lists.infradead.org; linux-omap@vger.kernel.org; linux-kernel@vger.kernel.org; J, KEERTHY; Benoît Cousson
Subject: Re: [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support

On 09/17/2014 04:20 PM, Shilimkar, Santosh wrote:
> Sorry for the format. Emailing from webmail.
> ________________________________________

[ ... ]


>> +     cx->mpu_state_vote++;
>> +     if (cx->mpu_state_vote == num_online_cpus()) {
>> +             pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
>> +             omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
>> +     }
>> +     raw_spin_unlock_irqrestore(&mpu_lock, flag);
>> +
>> +     omap4_enter_lowpower(dev->cpu, cx->cpu_state);
>> +
>> +     raw_spin_lock_irqsave(&mpu_lock, flag);
>> +     if (cx->mpu_state_vote == num_online_cpus())
>> +             omap_set_pwrdm_state(mpu_pd, PWRDM_POWER_ON);
>> +     cx->mpu_state_vote--;
>> +     raw_spin_unlock_irqrestore(&mpu_lock, flag);
>
> I am not sure that will work. What happens if a cpu exits idle and then
> re-enter idle immediately ?
>
> [Santosh] It works and that case is already taken care. CPU exist the idle and then votes
> out for cluster state and if it reenters with the right targeted state, the cluster state would
> be picked.

It isn't possible to have one cpu disabling the coherency, while the
other one is looking for a lock ? Or eg. cpu0 is on WFI then cpu1 is the
last entering idle. While cpu1 is entering 'lowpower', cpu0 exits the
wfi check the state vote and set the power domain on. In the meantime
cpu1 disables the coherency and cpu0 decrease the vote and release the
lock. Could be possible there is a very small racy window here ?

[Santosh] The coherency isn't disable by CPU. Thats actually taken care by
hardware. CPU takes it own power domain down and takes itself out of
coherency. The Coherency is always ON as long as there is a CPU ON
and SMP bit on that CPU is enabled.

The scenario, you mentioned can never happen on this hardware thanks
to the inbuilt smart hardware.

If you have more questions, lets discuss. I am around here at connect. ;-)

Regards,
Santosh--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

WARNING: multiple messages have this Message-ID (diff)
From: santosh.shilimkar@ti.com (Shilimkar, Santosh)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support
Date: Thu, 18 Sep 2014 00:42:48 +0000	[thread overview]
Message-ID: <448912EABC71F84BBCADFD3C67C4BE52CAC8B9@DBDE04.ent.ti.com> (raw)
In-Reply-To: <541A25DA.8030101@linaro.org>


________________________________________
From: Daniel Lezcano [daniel.lezcano at linaro.org]
Sent: Wednesday, September 17, 2014 8:22 PM
To: Shilimkar, Santosh; Menon, Nishanth; Tony Lindgren; Kristo, Tero; Paul Walmsley
Cc: Kevin Hilman; linux-arm-kernel at lists.infradead.org; linux-omap at vger.kernel.org; linux-kernel at vger.kernel.org; J, KEERTHY; Beno?t Cousson
Subject: Re: [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support

On 09/17/2014 04:20 PM, Shilimkar, Santosh wrote:
> Sorry for the format. Emailing from webmail.
> ________________________________________

[ ... ]


>> +     cx->mpu_state_vote++;
>> +     if (cx->mpu_state_vote == num_online_cpus()) {
>> +             pwrdm_set_logic_retst(mpu_pd, cx->mpu_logic_state);
>> +             omap_set_pwrdm_state(mpu_pd, cx->mpu_state);
>> +     }
>> +     raw_spin_unlock_irqrestore(&mpu_lock, flag);
>> +
>> +     omap4_enter_lowpower(dev->cpu, cx->cpu_state);
>> +
>> +     raw_spin_lock_irqsave(&mpu_lock, flag);
>> +     if (cx->mpu_state_vote == num_online_cpus())
>> +             omap_set_pwrdm_state(mpu_pd, PWRDM_POWER_ON);
>> +     cx->mpu_state_vote--;
>> +     raw_spin_unlock_irqrestore(&mpu_lock, flag);
>
> I am not sure that will work. What happens if a cpu exits idle and then
> re-enter idle immediately ?
>
> [Santosh] It works and that case is already taken care. CPU exist the idle and then votes
> out for cluster state and if it reenters with the right targeted state, the cluster state would
> be picked.

It isn't possible to have one cpu disabling the coherency, while the
other one is looking for a lock ? Or eg. cpu0 is on WFI then cpu1 is the
last entering idle. While cpu1 is entering 'lowpower', cpu0 exits the
wfi check the state vote and set the power domain on. In the meantime
cpu1 disables the coherency and cpu0 decrease the vote and release the
lock. Could be possible there is a very small racy window here ?

[Santosh] The coherency isn't disable by CPU. Thats actually taken care by
hardware. CPU takes it own power domain down and takes itself out of
coherency. The Coherency is always ON as long as there is a CPU ON
and SMP bit on that CPU is enabled.

The scenario, you mentioned can never happen on this hardware thanks
to the inbuilt smart hardware.

If you have more questions, lets discuss. I am around here at connect. ;-)

Regards,
Santosh

  reply	other threads:[~2014-09-18  0:43 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 14:02 [PATCH 00/10] ARM: OMAP5 / DRA7: Add framework for suspend and cpuidle Nishanth Menon
2014-08-22 14:02 ` Nishanth Menon
2014-08-22 14:02 ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 01/10] ARM: OMAP5 / DRA7: PM: Update CPU context register offset Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 02/10] ARM: OMAP5 / DRA7: PM: Set MPUSS-EMIF clock-domain static dependency Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-27 18:44   ` Kevin Hilman
2014-08-27 18:44     ` Kevin Hilman
2014-08-22 14:02 ` [PATCH 03/10] ARM: OMAP5 / DRA7: PM / wakeupgen: Enables ES2 PM mode by default Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 04/10] ARM: OMAP5 / DRA7: PM: Enable Mercury retention mode on CPUx powerdomains Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 05/10] ARM: OMAP5 / DRA7: PM: Avoid all SAR saves Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 06/10] ARM: OMAP5 / DRA7: PM: Provide a dummy startup function for CPU hotplug Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 07/10] ARM: OMAP5 / DRA7: Enable CPU RET on suspend Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-27 18:58   ` Kevin Hilman
2014-08-27 18:58     ` Kevin Hilman
2014-08-27 19:05     ` Nishanth Menon
2014-08-27 19:05       ` Nishanth Menon
2014-08-27 19:41       ` Tony Lindgren
2014-08-27 19:41         ` Tony Lindgren
2014-08-27 19:43         ` Santosh Shilimkar
2014-08-27 19:43           ` Santosh Shilimkar
2014-08-27 19:45           ` Nishanth Menon
2014-08-27 19:45             ` Nishanth Menon
2014-09-05 21:15             ` Nishanth Menon
2014-09-05 21:15               ` Nishanth Menon
2014-09-05 21:30               ` Tony Lindgren
2014-09-05 21:30                 ` Tony Lindgren
2014-09-08 17:23               ` Grazvydas Ignotas
2014-09-08 17:23                 ` Grazvydas Ignotas
2014-09-08 18:34                 ` Nishanth Menon
2014-09-08 18:34                   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 08/10] ARM: OMAP5/DRA7: PM: cpuidle MPU CSWR support Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-27 19:13   ` Kevin Hilman
2014-08-27 19:13     ` Kevin Hilman
2014-08-27 19:35     ` Nishanth Menon
2014-08-27 19:35       ` Nishanth Menon
2014-08-27 19:41       ` Santosh Shilimkar
2014-08-27 19:41         ` Santosh Shilimkar
2014-08-27 20:22         ` Kevin Hilman
2014-08-27 20:22           ` Kevin Hilman
2014-09-05 21:18           ` Nishanth Menon
2014-09-05 21:18             ` Nishanth Menon
2014-09-05 21:18             ` Nishanth Menon
2014-09-16 16:34             ` Nishanth Menon
2014-09-16 16:34               ` Nishanth Menon
2014-09-16 16:34               ` Nishanth Menon
2014-09-17 18:49   ` Daniel Lezcano
2014-09-17 18:49     ` Daniel Lezcano
2014-09-17 18:49     ` Daniel Lezcano
2014-09-17 23:20     ` Shilimkar, Santosh
2014-09-17 23:20       ` Shilimkar, Santosh
2014-09-17 23:20       ` Shilimkar, Santosh
2014-09-18  0:22       ` Daniel Lezcano
2014-09-18  0:22         ` Daniel Lezcano
2014-09-18  0:42         ` Shilimkar, Santosh [this message]
2014-09-18  0:42           ` Shilimkar, Santosh
2014-09-18  0:42           ` Shilimkar, Santosh
2014-09-18 13:41         ` Nishanth Menon
2014-09-18 13:41           ` Nishanth Menon
2014-09-18 13:50           ` Nishanth Menon
2014-09-18 13:50             ` Nishanth Menon
2014-09-22 13:02             ` Nishanth Menon
2014-09-22 13:02               ` Nishanth Menon
2014-09-22 13:17               ` Nishanth Menon
2014-09-22 13:17                 ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 09/10] ARM: OMAP5: Add hook in SoC initcalls to enable pm initialization Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02 ` [PATCH 10/10] ARM: DRA7: " Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-22 14:02   ` Nishanth Menon
2014-08-25 16:36 ` [PATCH 00/10] ARM: OMAP5 / DRA7: Add framework for suspend and cpuidle Nishanth Menon
2014-08-25 16:36   ` Nishanth Menon
2014-08-27 19:15 ` Kevin Hilman
2014-08-27 19:15   ` Kevin Hilman
2014-09-08 16:29   ` Nishanth Menon
2014-09-08 16:29     ` Nishanth Menon

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=448912EABC71F84BBCADFD3C67C4BE52CAC8B9@DBDE04.ent.ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=bcousson@baylibre.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=j-keerthy@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=paul@pwsan.com \
    --cc=t-kristo@ti.com \
    --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.