From: Abhilash Kesavan <kesavan.abhilash@gmail.com> To: Nicolas Pitre <nicolas.pitre@linaro.org> Cc: linux-samsung-soc <linux-samsung-soc@vger.kernel.org>, linux-arm-kernel <linux-arm-kernel@lists.infradead.org>, Kukjin Kim <kgene.kim@samsung.com>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Andrew Bresticker <abrestic@chromium.org>, Douglas Anderson <dianders@chromium.org> Subject: Re: [PATCH v6] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Date: Sat, 5 Jul 2014 01:19:25 +0530 [thread overview] Message-ID: <CAM4voa=K6s0FFmeuiqWZh6HSQZAfSpxL8A_kMTxCi+2t3tzydw@mail.gmail.com> (raw) In-Reply-To: <CAM4voamqpCj=Zw69DGjzhouwu=6RE6e3Px5WL8akc-TUAts0Xg@mail.gmail.com> Hi Nicolas, On Sat, Jul 5, 2014 at 12:32 AM, Abhilash Kesavan <kesavan.abhilash@gmail.com> wrote: > Hi Nicolas, > > On Sat, Jul 5, 2014 at 12:00 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: >> On Fri, 4 Jul 2014, Abhilash Kesavan wrote: >> >>> On Fri, Jul 4, 2014 at 9:43 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: >>> > Another suggestion which might possibly be better: why not looking for >>> > the SYS_PWR_CFG bit in exynos_cpu_power_down() directly? After all, >>> > exynos_cpu_power_down() is semantically supposed to do what its name >>> > suggest and could simply do nothing if the proper conditions are already >>> > in place. >>> I have implemented this and it works fine. Patch coming up. >> >> On Fri, 4 Jul 2014, Abhilash Kesavan wrote: >> >>> Use the MCPM layer to handle core suspend/resume on Exynos5420. >>> Also, restore the entry address setup code post-resume. >>> >>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> >>> --- >>> Changes in v2: >>> - Made use of the MCPM suspend/powered_up call-backs >>> Changes in v3: >>> - Used the residency value to indicate the entered state >>> Changes in v4: >>> - Checked if MCPM has been enabled to prevent build error >>> Changes in v5: >>> - Removed the MCPM flags and just used a local flag to >>> indicate that we are suspending. >>> Changes in v6: >>> - Read the SYS_PWR_REG value to decide if we are suspending >>> the system. >>> - Restore the SYS_PWR_REG value post-resume. >>> - Modified the comments to reflect the first change. >> >> [...] >> >>> @@ -150,7 +153,15 @@ static void exynos_power_down(void) >>> BUG_ON(__mcpm_cluster_state(cluster) != CLUSTER_UP); >>> cpu_use_count[cpu][cluster]--; >>> if (cpu_use_count[cpu][cluster] == 0) { >>> - exynos_cpu_power_down(cpunr); >>> + /* >>> + * Bypass power down for CPU0 during suspend. Check for >>> + * the SYS_PWR_REG value to decide if we are suspending >>> + * the system. >>> + */ >>> + temp = __raw_readl(pmu_base_addr + >>> + EXYNOS5_ARM_CORE0_SYS_PWR_REG); >>> + if ((cpu != 0) || ((temp & S5P_CORE_LOCAL_PWR_EN) != 0)) >>> + exynos_cpu_power_down(cpunr); >> >> Nah... We're going in circles, aren't we? >> >> What I suggested above is: >> >> diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c >> index 67d383de61..0a48421860 100644 >> --- a/arch/arm/mach-exynos/pm.c >> +++ b/arch/arm/mach-exynos/pm.c >> @@ -110,6 +110,16 @@ static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) >> */ >> void exynos_cpu_power_down(int cpu) >> { >> + if (soc_is_exynos5250() && cpu == 0) { >> + /* >> + * Bypass power down for CPU0 during suspend. Check for >> + * the SYS_PWR_REG value to decide if we are suspending >> + * the system. >> + */ >> + int val = __raw_readl(pmu_base_addr +EXYNOS5_ARM_CORE0_SYS_PWR_REG); >> + if (!(val & S5P_CORE_LOCAL_PWR_EN)) >> + return; >> + } >> __raw_writel(0, EXYNOS_ARM_CORE_CONFIGURATION(cpu)); >> } > Ah, I get it, much nicer indeed. Will change. On a different note, I have been using the cpuidle patchset (https://patchwork.kernel.org/patch/4357421/) as base for S2R support and had a question. Rather than making the driver depend on ARCH_EXYNOS should it depend on EXYNOS5420_MCPM which in turn depends on MCPM (like TC2) or should we just be making the bL cpuidle driver depend on MCPM ? Regards, Abhilash >> >> >> Nicolas
WARNING: multiple messages have this Message-ID (diff)
From: kesavan.abhilash@gmail.com (Abhilash Kesavan) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v6] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Date: Sat, 5 Jul 2014 01:19:25 +0530 [thread overview] Message-ID: <CAM4voa=K6s0FFmeuiqWZh6HSQZAfSpxL8A_kMTxCi+2t3tzydw@mail.gmail.com> (raw) In-Reply-To: <CAM4voamqpCj=Zw69DGjzhouwu=6RE6e3Px5WL8akc-TUAts0Xg@mail.gmail.com> Hi Nicolas, On Sat, Jul 5, 2014 at 12:32 AM, Abhilash Kesavan <kesavan.abhilash@gmail.com> wrote: > Hi Nicolas, > > On Sat, Jul 5, 2014 at 12:00 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: >> On Fri, 4 Jul 2014, Abhilash Kesavan wrote: >> >>> On Fri, Jul 4, 2014 at 9:43 AM, Nicolas Pitre <nicolas.pitre@linaro.org> wrote: >>> > Another suggestion which might possibly be better: why not looking for >>> > the SYS_PWR_CFG bit in exynos_cpu_power_down() directly? After all, >>> > exynos_cpu_power_down() is semantically supposed to do what its name >>> > suggest and could simply do nothing if the proper conditions are already >>> > in place. >>> I have implemented this and it works fine. Patch coming up. >> >> On Fri, 4 Jul 2014, Abhilash Kesavan wrote: >> >>> Use the MCPM layer to handle core suspend/resume on Exynos5420. >>> Also, restore the entry address setup code post-resume. >>> >>> Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com> >>> --- >>> Changes in v2: >>> - Made use of the MCPM suspend/powered_up call-backs >>> Changes in v3: >>> - Used the residency value to indicate the entered state >>> Changes in v4: >>> - Checked if MCPM has been enabled to prevent build error >>> Changes in v5: >>> - Removed the MCPM flags and just used a local flag to >>> indicate that we are suspending. >>> Changes in v6: >>> - Read the SYS_PWR_REG value to decide if we are suspending >>> the system. >>> - Restore the SYS_PWR_REG value post-resume. >>> - Modified the comments to reflect the first change. >> >> [...] >> >>> @@ -150,7 +153,15 @@ static void exynos_power_down(void) >>> BUG_ON(__mcpm_cluster_state(cluster) != CLUSTER_UP); >>> cpu_use_count[cpu][cluster]--; >>> if (cpu_use_count[cpu][cluster] == 0) { >>> - exynos_cpu_power_down(cpunr); >>> + /* >>> + * Bypass power down for CPU0 during suspend. Check for >>> + * the SYS_PWR_REG value to decide if we are suspending >>> + * the system. >>> + */ >>> + temp = __raw_readl(pmu_base_addr + >>> + EXYNOS5_ARM_CORE0_SYS_PWR_REG); >>> + if ((cpu != 0) || ((temp & S5P_CORE_LOCAL_PWR_EN) != 0)) >>> + exynos_cpu_power_down(cpunr); >> >> Nah... We're going in circles, aren't we? >> >> What I suggested above is: >> >> diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c >> index 67d383de61..0a48421860 100644 >> --- a/arch/arm/mach-exynos/pm.c >> +++ b/arch/arm/mach-exynos/pm.c >> @@ -110,6 +110,16 @@ static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) >> */ >> void exynos_cpu_power_down(int cpu) >> { >> + if (soc_is_exynos5250() && cpu == 0) { >> + /* >> + * Bypass power down for CPU0 during suspend. Check for >> + * the SYS_PWR_REG value to decide if we are suspending >> + * the system. >> + */ >> + int val = __raw_readl(pmu_base_addr +EXYNOS5_ARM_CORE0_SYS_PWR_REG); >> + if (!(val & S5P_CORE_LOCAL_PWR_EN)) >> + return; >> + } >> __raw_writel(0, EXYNOS_ARM_CORE_CONFIGURATION(cpu)); >> } > Ah, I get it, much nicer indeed. Will change. On a different note, I have been using the cpuidle patchset (https://patchwork.kernel.org/patch/4357421/) as base for S2R support and had a question. Rather than making the driver depend on ARCH_EXYNOS should it depend on EXYNOS5420_MCPM which in turn depends on MCPM (like TC2) or should we just be making the bL cpuidle driver depend on MCPM ? Regards, Abhilash >> >> >> Nicolas
next prev parent reply other threads:[~2014-07-04 19:49 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-07-04 18:30 [PATCH v6] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Nicolas Pitre 2014-07-04 19:02 ` Abhilash Kesavan 2014-07-04 19:02 ` Abhilash Kesavan 2014-07-04 19:49 ` Abhilash Kesavan [this message] 2014-07-04 19:49 ` Abhilash Kesavan 2014-07-04 21:03 ` Nicolas Pitre 2014-07-04 21:03 ` Nicolas Pitre 2014-07-04 21:22 ` Abhilash Kesavan 2014-07-04 21:22 ` Abhilash Kesavan -- strict thread matches above, loose matches on Subject: below -- 2014-07-03 14:46 [PATCH v5] " Abhilash Kesavan 2014-07-04 17:47 ` [PATCH v6] " Abhilash Kesavan 2014-07-04 17:47 ` Abhilash Kesavan
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='CAM4voa=K6s0FFmeuiqWZh6HSQZAfSpxL8A_kMTxCi+2t3tzydw@mail.gmail.com' \ --to=kesavan.abhilash@gmail.com \ --cc=abrestic@chromium.org \ --cc=dianders@chromium.org \ --cc=kgene.kim@samsung.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=lorenzo.pieralisi@arm.com \ --cc=nicolas.pitre@linaro.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: linkBe 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.