From patchwork Fri Jul 4 18:30:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 4482951 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E5779F26C for ; Fri, 4 Jul 2014 18:30:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E8F420381 for ; Fri, 4 Jul 2014 18:30:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BEFA20357 for ; Fri, 4 Jul 2014 18:30:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbaGDSaa (ORCPT ); Fri, 4 Jul 2014 14:30:30 -0400 Received: from mail-qg0-f54.google.com ([209.85.192.54]:53402 "EHLO mail-qg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbaGDSaa (ORCPT ); Fri, 4 Jul 2014 14:30:30 -0400 Received: by mail-qg0-f54.google.com with SMTP id q107so1731180qgd.13 for ; Fri, 04 Jul 2014 11:30:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version:content-type; bh=BuRBeKyndlCAOMD30D8oPMHezBWk87B9gBzKMtJKKT8=; b=iK2FGcfq2u4d34OBbW9utxNQ7SuW1XYfXZ1GQFM0oVlW0dT3b5wJY0y1xf4IXoZeEn +XuNW+/NOT1LG0MhrcUf782EAo5/mhso48TXnm98nrv5FZGhvFWM/5kJ5YCcxt3+/CoA T3opPhuzDVxotRiu2Ap8LsiWRNzBMN65E9jjAq41yTqSD/FzXeH63CKmmfDos+zoy6dd VUXwzyanmBfhxo3VnLIW4U2WYk0gY/iBb5VYg/KJWRzZEvB4arAf6y5BjkrAiZDu1sXM tlmQFttPzwLdH7tfTiZ+TbE8je8+nG7k+3t/vkNDE3sjrpJuIORBs8FWvrK40/0pOeXw mTlg== X-Gm-Message-State: ALoCoQkkRMZUqDjJnr3M7LsvV0cKX6GpORNDXV5M3H5G2+IfQNcCUZx+eyB+Is6iVvll5CBHfoeJ X-Received: by 10.229.35.133 with SMTP id p5mr21106282qcd.0.1404498629712; Fri, 04 Jul 2014 11:30:29 -0700 (PDT) Received: from xanadu.home (modemcable177.143-130-66.mc.videotron.ca. [66.130.143.177]) by mx.google.com with ESMTPSA id z14sm57031828qaw.7.2014.07.04.11.30.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 11:30:28 -0700 (PDT) Date: Fri, 4 Jul 2014 14:30:27 -0400 (EDT) From: Nicolas Pitre To: Abhilash Kesavan , Abhilash Kesavan cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kgene.kim@samsung.com, Lorenzo Pieralisi , Andrew Bresticker , Douglas Anderson Subject: Re: [PATCH v6] ARM: EXYNOS: Use MCPM call-backs to support S2R on Exynos5420 Message-ID: User-Agent: Alpine 2.11 (LFD 23 2013-08-11) MIME-Version: 1.0 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, 4 Jul 2014, Abhilash Kesavan wrote: > On Fri, Jul 4, 2014 at 9:43 AM, Nicolas Pitre 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 > --- > 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: Nicolas --- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)); }