From patchwork Fri Aug 8 04:00:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 35081 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 345662397D for ; Fri, 8 Aug 2014 04:01:20 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id le20sf14020707vcb.5 for ; Thu, 07 Aug 2014 21:01:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=e1O4k0UNq3CZMQ8ydJTS8ewA9aHzNkodgsahzByimBE=; b=WSbF2u/NHvPnE2bfWQGcOeJ2aCjuysAKcIMe+y9adKA6x3Y+r//nlVaiMrXcmmHxxX h9zYD9exuiLwCDX6u44jkG0xJrp6qSJtEYvu/tOVloeu5A5PLwts5jqlyJwFOeo6wlcW ktJXNPEZZXaQIkZtAiMwsSj9vLEkVbAUzBABIsaqh5Kt7iQZqPaDYKRrMy3D8nbID0Rg cBQgLu+rKkd2IYgm0/lecceV9gR3hcIOmfaOso5NZyfXgZWLAXtAFzOm7x3qu3Pvj9jS aeJ2l4W5dvXNvotZ5rySmjgCIv5GHtxZL8QsZKbVg/jNNJKqWvfkjqt9uXtmq2Po010W pucA== X-Gm-Message-State: ALoCoQnon1OGGcQCo3YLZT0loOoopoBSHC2fccWOGlNVI5hrEmGO3SHGogWwmkOTc4XtWg9Jxpem X-Received: by 10.236.117.141 with SMTP id j13mr3556113yhh.3.1407470479929; Thu, 07 Aug 2014 21:01:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.117 with SMTP id k108ls356656qgf.3.gmail; Thu, 07 Aug 2014 21:01:19 -0700 (PDT) X-Received: by 10.220.81.194 with SMTP id y2mr19780284vck.29.1407470479863; Thu, 07 Aug 2014 21:01:19 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id bl6si2486181vdd.61.2014.08.07.21.01.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Aug 2014 21:01:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id hq11so7569658vcb.2 for ; Thu, 07 Aug 2014 21:01:19 -0700 (PDT) X-Received: by 10.52.15.8 with SMTP id t8mr5107675vdc.18.1407470479792; Thu, 07 Aug 2014 21:01:19 -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 tc5csp86913vcb; Thu, 7 Aug 2014 21:01:19 -0700 (PDT) X-Received: by 10.66.240.197 with SMTP id wc5mr21764543pac.87.1407470478573; Thu, 07 Aug 2014 21:01:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b11si1450465pdj.25.2014.08.07.21.01.17 for ; Thu, 07 Aug 2014 21:01:18 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-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 S1752299AbaHHEBR (ORCPT + 4 others); Fri, 8 Aug 2014 00:01:17 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:54074 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750842AbaHHEBQ (ORCPT ); Fri, 8 Aug 2014 00:01:16 -0400 Received: by mail-ie0-f174.google.com with SMTP id rp18so5580719iec.5 for ; Thu, 07 Aug 2014 21:01:16 -0700 (PDT) X-Received: by 10.43.127.136 with SMTP id ha8mr9123801icc.78.1407470476396; Thu, 07 Aug 2014 21:01:16 -0700 (PDT) Received: from localhost.localdomain (c-24-8-37-141.hsd1.co.comcast.net. [24.8.37.141]) by mx.google.com with ESMTPSA id yt6sm4062230igb.10.2014.08.07.21.01.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Aug 2014 21:01:15 -0700 (PDT) From: Lina Iyer To: daniel.lezcano@linaro.org, khilman@linaro.org, amit.kucheria@linaro.org, sboyd@codeaurora.org, davidb@codeaurora.org, galak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@vger.kernel.org Cc: msivasub@codeaurora.org, bryanh@codeaurora.org, Lina Iyer Subject: [RFC] [PATCH 10/13] qcom: platsmp: Enable deeper idle states for hotplug Date: Thu, 7 Aug 2014 22:00:55 -0600 Message-Id: <1407470458-22900-11-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407470458-22900-1-git-send-email-lina.iyer@linaro.org> References: <1407470458-22900-1-git-send-email-lina.iyer@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lina.iyer@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.171 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: , Allow cpu and system deeper sleep modes when a cpu is hotplugged. Calling wfi() executes architectural clock gating supported by the ARM core, while this is useful, it does not save leakage power and does not help in reducing power in the peripheral logic surrounding the cpu. QCOM platforms have a sub-system power manager to control the logic around the core. Pass the hotplug call over to SoC idle interface driver to allow for the core and the peripheral logic to enter low power when hotplugged. Signed-off-by: Lina Iyer --- arch/arm/mach-qcom/platsmp.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c index d690856..c40f220 100644 --- a/arch/arm/mach-qcom/platsmp.c +++ b/arch/arm/mach-qcom/platsmp.c @@ -20,7 +20,8 @@ #include -#include "scm-boot.h" +#include +#include #define VDD_SC1_ARRAY_CLAMP_GFS_CTL 0x35a0 #define SCSS_CPU1CORE_RESET 0x2d80 @@ -51,12 +52,30 @@ static DEFINE_SPINLOCK(boot_lock); #ifdef CONFIG_HOTPLUG_CPU static void __ref qcom_cpu_die(unsigned int cpu) { +#if defined CONFIG_QCOM_PM + for (;;) + msm_pm_cpu_hotplug_enter(cpu); +#else wfi(); +#endif +} + +static int __ref qcom_cpu_kill(unsigned int cpu) +{ + int ret = 0; + +#if defined CONFIG_QCOM_PM + ret = msm_pm_wait_cpu_shutdown(cpu) ? 0 : 1; +#endif + return ret; } + #endif static void qcom_secondary_init(unsigned int cpu) { + msm_pm_secondary_startup(cpu); + /* * Synchronise with the boot thread. */ @@ -373,6 +392,7 @@ static struct smp_operations qcom_smp_kpssv2_ops __initdata = { .smp_boot_secondary = kpssv2_boot_secondary, #ifdef CONFIG_HOTPLUG_CPU .cpu_die = qcom_cpu_die, + .cpu_kill = qcom_cpu_kill, #endif }; CPU_METHOD_OF_DECLARE(qcom_smp_kpssv2, "qcom,kpss-acc-v2", &qcom_smp_kpssv2_ops);