From: khilman@linaro•org (Kevin Hilman)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v2 09/18] ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method
Date: Thu, 04 Apr 2013 10:42:22 -0700 [thread overview]
Message-ID: <87li8ynqf5.fsf@linaro.org> (raw)
In-Reply-To: <515D8215.10705@ti.com> (Santosh Shilimkar's message of "Thu, 4 Apr 2013 19:07:25 +0530")
Santosh Shilimkar <santosh.shilimkar@ti•com> writes:
> On Thursday 04 April 2013 02:24 AM, Kevin Hilman wrote:
>> Santosh Shilimkar <santosh.shilimkar@ti•com> writes:
>>
>>> While waking up CPU from off state using clock domain force wakeup, restore
>>> the CPU power state to ON state before putting CPU clock domain under
>>> hardware control. Otherwise CPU wakeup might fail. The change is recommended
>>> for all OMAP4+ devices though the PRCM weakness was observed on OMAP5
>>> devices first.
>>
>> Sounds reasonable, but can you describe the "weakness" a little more?
>>
>> IOW, what exactly happens if this is not done? It sounds like the CPU
>> might immediately go back to retention, but how does that happen unless
>> it does a WFI?
>>
> Its more of lock-up inside the hardware state machine and results
> are UN-predictable. We have seen hard-locks most of the time where system
> is just frozen. The hardware gets into wrong state machine if the power
> domain state isn't restored. I will add this information to changelog.
>
>> Also, this sounds like a fix to me, and should probably be broken out
>> accordingly.
>>
> Yeah. You mean a separate patch from the series, right ? This patch
> actually can be independently added.
>
> In case you decide to apply it for the fixes branch, updated patch
> at end of the email.
Curious which branch you applied it to? It didn't apply cleanly to
v3.9-rc5 (but did with fuzz).
So I've now added it to my for_3.10/fixes/pm branch.
Kevin
> From a0cef44760d859b63a34603010f8c0621da4b8ab Mon Sep 17 00:00:00 2001
> From: Santosh Shilimkar <santosh.shilimkar@ti•com>
> Date: Fri, 8 Feb 2013 22:50:58 +0530
> Subject: [PATCH] ARM: OMAP4+: PM: Restore CPU power state to ON with
> clockdomain force wakeup method
>
> While waking up CPU from off state using clock domain force wakeup, restore
> the CPU power state to ON state before putting CPU clock domain under
> hardware control. Otherwise CPU wakeup might fail. The change is recommended
> for all OMAP4+ devices though the PRCM weakness was observed on OMAP5
> devices first.
>
> As a result of weakness, lock-up is observed inside the hardware state
> machine of local CPU PRCM and results are UN-predictable as per designers.
> In software testing, we have seen hard-locks most of the time where system
> gets frozen. With power domain state restored, system behaves correctly.
>
> So update the code accordingly.
>
> Acked-by: Nishanth Menon <nm@ti•com>
> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti•com>
> ---
> arch/arm/mach-omap2/cpuidle44xx.c | 1 +
> arch/arm/mach-omap2/omap-smp.c | 12 ++++++++++--
> 2 files changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
> index 944e64a..9de47a7 100644
> --- a/arch/arm/mach-omap2/cpuidle44xx.c
> +++ b/arch/arm/mach-omap2/cpuidle44xx.c
> @@ -131,6 +131,7 @@ static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
> /* Wakeup CPU1 only if it is not offlined */
> if (dev->cpu == 0 && cpumask_test_cpu(1, cpu_online_mask)) {
> clkdm_wakeup(cpu_clkdm[1]);
> + omap_set_pwrdm_state(cpu_pd[1], PWRDM_POWER_ON);
> clkdm_allow_idle(cpu_clkdm[1]);
> }
>
> diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
> index 5b20165..8106e8d 100644
> --- a/arch/arm/mach-omap2/omap-smp.c
> +++ b/arch/arm/mach-omap2/omap-smp.c
> @@ -83,6 +83,7 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
> {
> static struct clockdomain *cpu1_clkdm;
> static bool booted;
> + static struct powerdomain *cpu1_pwrdm;
> void __iomem *base = omap_get_wakeupgen_base();
>
> /*
> @@ -102,8 +103,10 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
> else
> __raw_writel(0x20, base + OMAP_AUX_CORE_BOOT_0);
>
> - if (!cpu1_clkdm)
> + if (!cpu1_clkdm && !cpu1_pwrdm) {
> cpu1_clkdm = clkdm_lookup("mpu1_clkdm");
> + cpu1_pwrdm = pwrdm_lookup("cpu1_pwrdm");
> + }
>
> /*
> * The SGI(Software Generated Interrupts) are not wakeup capable
> @@ -116,7 +119,7 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
> * Section :
> * 4.3.4.2 Power States of CPU0 and CPU1
> */
> - if (booted) {
> + if (booted && cpu1_pwrdm && cpu1_clkdm) {
> /*
> * GIC distributor control register has changed between
> * CortexA9 r1pX and r2pX. The Control Register secure
> @@ -137,7 +140,12 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
> gic_dist_disable();
> }
>
> + /*
> + * Ensure that CPU power state is set to ON to avoid CPU
> + * powerdomain transition on wfi
> + */
> clkdm_wakeup(cpu1_clkdm);
> + omap_set_pwrdm_state(cpu1_pwrdm, PWRDM_POWER_ON);
> clkdm_allow_idle(cpu1_clkdm);
>
> if (IS_PM44XX_ERRATUM(PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD)) {
next prev parent reply other threads:[~2013-04-04 17:42 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 10:04 [PATCH v2 00/18] ARM: OMAP5: PM: Add MPUSS suspend and CPUidle support Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 01/18] ARM: OMAP4+: PM: Consolidate MPU subsystem PM code for re-use Santosh Shilimkar
2013-04-03 19:44 ` Kevin Hilman
2013-04-04 11:32 ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 02/18] ARM: OMAP5: PM: Update CPU context register offset Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 03/18] ARM: OMAP4+: PM: Consolidate and use OMAP4 PM code for OMAP5 Santosh Shilimkar
2013-04-03 20:20 ` Kevin Hilman
2013-04-04 11:51 ` Santosh Shilimkar
2013-04-04 11:55 ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 04/18] ARM: OMAP5: PM: Set MPUSS-EMIF clock-domain static dependency Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 05/18] ARM: OMAP5: PM: Enables ES2 PM mode by default Santosh Shilimkar
2013-04-03 20:25 ` Kevin Hilman
2013-04-04 12:02 ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 06/18] ARM: OMAP5: PM: Enable Mercury retention mode on CPUx powerdomains Santosh Shilimkar
2013-04-03 20:31 ` Kevin Hilman
2013-04-04 12:08 ` Santosh Shilimkar
2013-03-25 10:04 ` [PATCH v2 07/18] ARM: OMAP5: Add init_late() hook to enable pm initialization Santosh Shilimkar
2013-04-03 20:33 ` Kevin Hilman
2013-04-04 12:28 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 08/18] ARM: OMAP5: PM: Add CPU power off in hotplug path Santosh Shilimkar
2013-04-03 20:49 ` Kevin Hilman
2013-04-04 13:23 ` Santosh Shilimkar
2013-04-04 17:31 ` Kevin Hilman
2013-04-05 9:04 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 09/18] ARM: OMAP4+: PM: Restore CPU power state to ON with clockdomain force wakeup method Santosh Shilimkar
2013-04-03 20:54 ` Kevin Hilman
2013-04-04 13:37 ` Santosh Shilimkar
2013-04-04 17:42 ` Kevin Hilman [this message]
2013-04-05 9:07 ` Santosh Shilimkar
2013-04-05 11:58 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 10/18] ARM: OMAP5: PM: Add MPU Open Switch Retention support Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 11/18] ARM: OMAP5: PM: Add L2 memory power down support Santosh Shilimkar
2013-04-03 20:58 ` Kevin Hilman
2013-04-04 13:46 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 12/18] ARM: OMAP4: CPUidle: Avoid double idle driver registration Santosh Shilimkar
2013-04-03 21:03 ` Kevin Hilman
2013-04-04 13:47 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 13/18] ARM: OMAP: CPUidle: Unregister drivere on device registration failure Santosh Shilimkar
2013-04-03 21:03 ` Kevin Hilman
2013-04-04 13:48 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 14/18] ARM: OMAP4: CPUidle: Make C-state description field more precise Santosh Shilimkar
2013-04-03 21:05 ` Kevin Hilman
2013-04-04 13:48 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 15/18] ARM: OMAP4+: CPUidle: Consolidate idle driver for OMAP5 support Santosh Shilimkar
2013-04-03 21:10 ` Kevin Hilman
2013-04-04 14:04 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 16/18] ARM: OMAP4+: CPUidle: Deprecate use of omap4_mpuss_read_prev_context_state() Santosh Shilimkar
2013-04-03 21:37 ` Kevin Hilman
2013-04-04 13:59 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 17/18] ARM: OMAP4+: CPUidle: Add OMAP5 idle driver support Santosh Shilimkar
2013-04-03 21:25 ` Kevin Hilman
2013-04-04 14:16 ` Santosh Shilimkar
2013-04-04 17:55 ` Kevin Hilman
2013-04-05 9:41 ` Santosh Shilimkar
2013-03-25 10:05 ` [PATCH v2 18/18] ARM: OMAP5: PM: handle device instance for warm reset Santosh Shilimkar
2013-03-25 11:46 ` [PATCH v2 00/18] ARM: OMAP5: PM: Add MPUSS suspend and CPUidle support Lokesh Vutla
2013-03-25 12:10 ` Santosh Shilimkar
2013-03-25 12:27 ` Sourav Poddar
2013-03-25 12:47 ` Rajendra Nayak
2013-03-25 13:00 ` Sourav Poddar
2013-04-03 22:52 ` Kevin Hilman
2013-04-04 14:34 ` Santosh Shilimkar
2013-04-04 16:49 ` Santosh Shilimkar
2013-04-04 17:57 ` Kevin Hilman
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=87li8ynqf5.fsf@linaro.org \
--to=khilman@linaro$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox