From patchwork Fri Aug 8 04:05:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 35094 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 D79CE21457 for ; Fri, 8 Aug 2014 04:05:53 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id le20sf14032616vcb.5 for ; Thu, 07 Aug 2014 21:05:53 -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=mutW/r/uhtqbnxKt7aZMvOZqKnoXxdd8m4+jlUErVHkt6nAXTChQNGayVirWmkhyIX WA2o2GOn0xXhdkwjcINgfc5l//8hRcST41rvQTKbaBDAbfAvynTyLTk25vsH0g78ijXc Iu9HfnrVZODuJbyXQCgBkya9HxwNChPXS9CAsdWXGiAdLKD9EfO6WC/bvAqg/ParDnPy 1pbHKf3N/F6TiWOP+fMqbvuTgaRDfflDZj5ONZGeKEjbIxojZbch2J5pIzY718+KDq84 wDV+MhZljIm4zevE+Tip0w8uXOZhVMdkohbIWaLYHgPE2529iFBaOPGaRszyyXEqwNxc sz1w== X-Gm-Message-State: ALoCoQkO3jj1qupTtF7o/Z65MBEKJ3CQ9g4Y4X6QxdQr2FBiI8E2oK1WBw9B8M3wnjRY+5Se5JRx X-Received: by 10.236.23.230 with SMTP id v66mr2395734yhv.53.1407470753689; Thu, 07 Aug 2014 21:05:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.116 with SMTP id d107ls200167qga.67.gmail; Thu, 07 Aug 2014 21:05:53 -0700 (PDT) X-Received: by 10.52.249.9 with SMTP id yq9mr5143729vdc.6.1407470753613; Thu, 07 Aug 2014 21:05:53 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id im12si2495634vec.59.2014.08.07.21.05.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Aug 2014 21:05:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so7467477vcb.24 for ; Thu, 07 Aug 2014 21:05:53 -0700 (PDT) X-Received: by 10.52.164.199 with SMTP id ys7mr3491430vdb.42.1407470753528; Thu, 07 Aug 2014 21:05:53 -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 tc5csp87294vcb; Thu, 7 Aug 2014 21:05:53 -0700 (PDT) X-Received: by 10.66.236.6 with SMTP id uq6mr21626546pac.24.1407470752619; Thu, 07 Aug 2014 21:05:52 -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.05.52 for ; Thu, 07 Aug 2014 21:05:52 -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 S1752889AbaHHEFv (ORCPT + 4 others); Fri, 8 Aug 2014 00:05:51 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34840 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbaHHEFu (ORCPT ); Fri, 8 Aug 2014 00:05:50 -0400 Received: by mail-pa0-f52.google.com with SMTP id bj1so6566567pad.39 for ; Thu, 07 Aug 2014 21:05:50 -0700 (PDT) X-Received: by 10.66.254.66 with SMTP id ag2mr21411552pad.113.1407470750461; Thu, 07 Aug 2014 21:05:50 -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 n8sm2163342pdm.22.2014.08.07.21.05.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Aug 2014 21:05:49 -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 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:05:19 -0600 Message-Id: <1407470722-23015-11-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1407470722-23015-1-git-send-email-lina.iyer@linaro.org> References: <1407470722-23015-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.179 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);