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: 33113 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6447A20C88 for ; Fri, 4 Jul 2014 18:30:34 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf11977892pab.1 for ; Fri, 04 Jul 2014 11:30:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :user-agent:mime-version:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe:content-type; bh=ty53YO7fPP/9t536CUcAW/1mepM8YhNHHP5igx5Xjjo=; b=NHOTrfQJXelxhhHd1zFnYBe1Wb/nOVDxVp2sSxnqoWcgz5EWTth+5WxtHNBYubylRE fT8QjTCFmhnQ86ZfAjDdmfFDgrXhy1WKMuQKpnL9hSeHeOch1vzhkdxOggihg39FvI3W 5rbFeYDHyWtwepmRob/Z/l4MXPPPk313pg5OiTZ2MXbmmOveYyJKqJDAra+Iob7JmwAo ZoC12eepB5cfYARXgtVn+GZwEY9l2ZZvjFawVrYW2yUSVi7skUmRlxlKkDDGOxbr09j9 8sx/LatDmwMdwWoUWHGXTIPfJphATHOx1So9c9Rqshbxfb/RC7jimPsNvheoNR69rO4x lb6Q== X-Gm-Message-State: ALoCoQm1+yXvFw08Bo0/GVCORSGCuD80QZWVwITNcG1hTHAKUZpXF8enyBcxus0vdUrNtGkEgQZ7 X-Received: by 10.70.92.98 with SMTP id cl2mr5675507pdb.6.1404498633643; Fri, 04 Jul 2014 11:30:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.44.35 with SMTP id f32ls1004527qga.54.gmail; Fri, 04 Jul 2014 11:30:33 -0700 (PDT) X-Received: by 10.220.177.133 with SMTP id bi5mr10641480vcb.26.1404498633167; Fri, 04 Jul 2014 11:30:33 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id or9si15849608vcb.81.2014.07.04.11.30.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 11:30:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id ij19so1844502vcb.23 for ; Fri, 04 Jul 2014 11:30:33 -0700 (PDT) X-Received: by 10.220.185.202 with SMTP id cp10mr10635737vcb.15.1404498633039; Fri, 04 Jul 2014 11:30:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp482966vcb; Fri, 4 Jul 2014 11:30:32 -0700 (PDT) X-Received: by 10.68.173.1 with SMTP id bg1mr12105489pbc.13.1404498632135; Fri, 04 Jul 2014 11:30:32 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si2191720pdp.127.2014.07.04.11.30.31; Fri, 04 Jul 2014 11:30:31 -0700 (PDT) Received-SPF: none (google.com: linux-samsung-soc-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbaGDSaa (ORCPT + 8 others); 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-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: list List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: nicolas.pitre@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)); }