From patchwork Fri Aug 8 04:00:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 35077 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 57C7E21137 for ; Fri, 8 Aug 2014 04:01:17 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf32462021pab.1 for ; Thu, 07 Aug 2014 21:01:16 -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=lBaEvECxLahCJnA9yR7MvDgK8Rewn25K/33IqziFAjs=; b=bTUe5qEUaCj7pg0rRUWAYoLNWd5mdl9rpf8n1QyMaRhKeebDkmIL6xAVI0poT1/0dO 9SeNq59CWhygGG3+iqpbQVFkwoUk7AseKo/C7+XUrcYrJo8n4vkwsQLcPgq6ihf5rce+ 3l1EQafLIA+t78CUgmBIeanxfpNvRg9j2HBZYNs1JZttiGASfKHkUo+HfsKHPBHGvafq uCqXAOm41c3xFsEAQ1fa1lc7A2osXY6ilPtk92ngBABT/jlCpdM4noYUKfUGzJRv7D1Q SSCTfxEB+pGEeF/A6JvW3qt3J/LIw73SGHqo21i3Z7WVNKmiCFjrlREo0huPheRrNFD4 iBeg== X-Gm-Message-State: ALoCoQmBROkjKeBL1mOj+q5IH+ljUNiQ8PlHSK2UU2BKlBHpXSZNkEKv4Wml8QwhZ8d0LWFN+wBG X-Received: by 10.70.130.135 with SMTP id oe7mr2396699pdb.9.1407470476561; Thu, 07 Aug 2014 21:01:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.138 with SMTP id o10ls403331qga.98.gmail; Thu, 07 Aug 2014 21:01:16 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr19957337vcb.0.1407470476411; Thu, 07 Aug 2014 21:01:16 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id y7si2487222vcp.89.2014.08.07.21.01.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Aug 2014 21:01:16 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.177 as permitted sender) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id hy4so7463652vcb.8 for ; Thu, 07 Aug 2014 21:01:16 -0700 (PDT) X-Received: by 10.52.168.134 with SMTP id zw6mr5077089vdb.37.1407470476323; Thu, 07 Aug 2014 21:01:16 -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 tc5csp86905vcb; Thu, 7 Aug 2014 21:01:15 -0700 (PDT) X-Received: by 10.66.236.6 with SMTP id uq6mr21605151pac.24.1407470474508; Thu, 07 Aug 2014 21:01:14 -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.13 for ; Thu, 07 Aug 2014 21:01:14 -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 S1752025AbaHHEBN (ORCPT + 4 others); Fri, 8 Aug 2014 00:01:13 -0400 Received: from mail-ig0-f169.google.com ([209.85.213.169]:52304 "EHLO mail-ig0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889AbaHHEBM (ORCPT ); Fri, 8 Aug 2014 00:01:12 -0400 Received: by mail-ig0-f169.google.com with SMTP id r2so1969709igi.4 for ; Thu, 07 Aug 2014 21:01:11 -0700 (PDT) X-Received: by 10.50.153.83 with SMTP id ve19mr1546552igb.4.1407470471683; Thu, 07 Aug 2014 21:01:11 -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.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Aug 2014 21:01:11 -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 06/13] qcom: msm-pm: Add support for hotplug and secondary startup Date: Thu, 7 Aug 2014 22:00:51 -0600 Message-Id: <1407470458-22900-7-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.177 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: , Add hotplug and secondary startup entry point to cold or warm boot secondary cpus. Signed-off-by: Mahesh Sivasubramanian Signed-off-by: Lina Iyer --- drivers/soc/qcom/msm-pm.c | 36 ++++++++++++++++++++++++++++++++++++ include/soc/qcom/pm.h | 4 ++++ 2 files changed, 40 insertions(+) diff --git a/drivers/soc/qcom/msm-pm.c b/drivers/soc/qcom/msm-pm.c index 17a7c8c..4a6471d 100644 --- a/drivers/soc/qcom/msm-pm.c +++ b/drivers/soc/qcom/msm-pm.c @@ -216,3 +216,39 @@ bool msm_cpu_pm_enter_sleep(enum msm_pm_sleep_mode mode, bool from_idle) return exit_stat; } EXPORT_SYMBOL(msm_cpu_pm_enter_sleep); + +/** + * msm_pm_cpu_hotplug_enter - Entry point for SoC hotplug interface + * Set up cores to enter deeper sleep modes than just clock gating + * Find the best deepest low power mode that can enter + * + * @cpu - The cpu that is being hotplugged off + */ +int msm_pm_cpu_hotplug_enter(unsigned int cpu) +{ + enum msm_pm_sleep_mode mode = MSM_PM_SLEEP_MODE_NR; + int ret; + + if (msm_spm_is_mode_avail(MSM_SPM_MODE_POWER_COLLAPSE)) + mode = MSM_PM_SLEEP_MODE_POWER_COLLAPSE; + else if (msm_spm_is_mode_avail( MSM_SPM_MODE_RETENTION)) + mode = MSM_PM_SLEEP_MODE_RETENTION; + else + mode = MSM_PM_SLEEP_MODE_WAIT_FOR_INTERRUPT; + + ret = msm_cpu_pm_enter_sleep(mode, false) ? 0 : -EFAULT; + + return ret; +} +EXPORT_SYMBOL(msm_pm_cpu_hotplug_enter); + +/** + * msm_pm_secondary_startup() - Restore after hotplug resume + * + * @ cpu: the cpu thats coming up. + */ +int msm_pm_secondary_startup(unsigned int cpu) +{ + return msm_spm_set_low_power_mode(MSM_SPM_MODE_CLOCK_GATING, false); +} +EXPORT_SYMBOL(msm_pm_secondary_startup); diff --git a/include/soc/qcom/pm.h b/include/soc/qcom/pm.h index 01872ad..ed6124a 100644 --- a/include/soc/qcom/pm.h +++ b/include/soc/qcom/pm.h @@ -30,10 +30,14 @@ enum msm_pm_l2_scm_flag { #ifdef CONFIG_QCOM_PM bool msm_cpu_pm_enter_sleep(enum msm_pm_sleep_mode mode, bool from_idle); +int msm_pm_cpu_hotplug_enter(unsigned int cpu); +int msm_pm_secondary_startup(unsigned int cpu); #else static inline bool msm_cpu_pm_enter_sleep(enum msm_pm_sleep_mode mode, bool from_idle) { return true; } +static inline int msm_pm_cpu_hotplug_enter(unsigned int cpu) { return 0; } +static inline int msm_pm_secondary_startup(unsigned int cpu) { return 0; } #endif #endif /* __QCOM_PM_H */