From mboxrd@z Thu Jan 1 00:00:00 1970 From: Abhilash Kesavan Subject: Re: [PATCH v2] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Date: Tue, 1 Jul 2014 18:44:49 +0530 Message-ID: References: <1403780312-22885-1-git-send-email-a.kesavan@samsung.com> <1404152927-11168-1-git-send-email-a.kesavan@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from mail-qg0-f53.google.com ([209.85.192.53]:61313 "EHLO mail-qg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751513AbaGANOu (ORCPT ); Tue, 1 Jul 2014 09:14:50 -0400 Received: by mail-qg0-f53.google.com with SMTP id i50so3251755qgf.40 for ; Tue, 01 Jul 2014 06:14:50 -0700 (PDT) In-Reply-To: Sender: linux-samsung-soc-owner@vger.kernel.org List-Id: linux-samsung-soc@vger.kernel.org To: Nicolas Pitre Cc: linux-samsung-soc , linux-arm-kernel , Kukjin Kim , Lorenzo Pieralisi , Andrew Bresticker , Douglas Anderson Hi Nicolas, On Tue, Jul 1, 2014 at 9:49 AM, Nicolas Pitre wrote: > On Mon, 30 Jun 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 >> --- > [...] > > Could you tell me more about this? > >> @@ -150,7 +153,13 @@ 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. This is being >> + * taken care by the SYS_PWR_CFG bit in CORE0_SYS_PWR_REG. >> + */ >> + if ((cpunr != 0) || >> + (__raw_readl(pmu_base_addr + S5P_INFORM1) != S5P_CHECK_SLEEP)) >> + exynos_cpu_power_down(cpunr); > > What happens if CPU0 is the first in the cluster to be idled? Will it > remain powered up until all the others have gone idle too? This check is only for handling the S2R CPU0 case. In case of idle/switching the S5P_CHECK_SLEEP flag would not be set and hence there would be no change in behavior for them. During suspend, we enable the ARM_USE_STANDBY_WFI0 bit which tells the PMU when the CPU0 is ready to be suspended. This in conjunction with the sleep state core configuration (setting SYS_PWR_REG low) causes the CPU0 to go down. We should not write to the CPU0 power configuration register (exynos_cpu_power_down) along with this during suspend. Regards, Abhilash > > > Nicolas From mboxrd@z Thu Jan 1 00:00:00 1970 From: kesavan.abhilash@gmail.com (Abhilash Kesavan) Date: Tue, 1 Jul 2014 18:44:49 +0530 Subject: [PATCH v2] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 In-Reply-To: References: <1403780312-22885-1-git-send-email-a.kesavan@samsung.com> <1404152927-11168-1-git-send-email-a.kesavan@samsung.com> Message-ID: To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Nicolas, On Tue, Jul 1, 2014 at 9:49 AM, Nicolas Pitre wrote: > On Mon, 30 Jun 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 >> --- > [...] > > Could you tell me more about this? > >> @@ -150,7 +153,13 @@ 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. This is being >> + * taken care by the SYS_PWR_CFG bit in CORE0_SYS_PWR_REG. >> + */ >> + if ((cpunr != 0) || >> + (__raw_readl(pmu_base_addr + S5P_INFORM1) != S5P_CHECK_SLEEP)) >> + exynos_cpu_power_down(cpunr); > > What happens if CPU0 is the first in the cluster to be idled? Will it > remain powered up until all the others have gone idle too? This check is only for handling the S2R CPU0 case. In case of idle/switching the S5P_CHECK_SLEEP flag would not be set and hence there would be no change in behavior for them. During suspend, we enable the ARM_USE_STANDBY_WFI0 bit which tells the PMU when the CPU0 is ready to be suspended. This in conjunction with the sleep state core configuration (setting SYS_PWR_REG low) causes the CPU0 to go down. We should not write to the CPU0 power configuration register (exynos_cpu_power_down) along with this during suspend. Regards, Abhilash > > > Nicolas