From patchwork Fri Aug 8 04:05:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 35090 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f200.google.com (mail-yk0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9EB8721457 for ; Fri, 8 Aug 2014 04:05:46 +0000 (UTC) Received: by mail-yk0-f200.google.com with SMTP id 9sf15070779ykp.11 for ; Thu, 07 Aug 2014 21:05:46 -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=TooU2oJzuEs8EQlC/Sv9o+1Qf0XaEJu1WVlQ5Ft6bMQiGI4sWmYj4nO0j/umJVCP+O XonwBqQcYXugyHOZ3PLCEjwVK4bnzHLxJlDEo7N8tNbwyx2qwXgrf17uYlqNIsIjV4H5 OnYMWzqq5D9goHISYI9SFpD86CEXIWkOmQ/dWFESpcyx4sQrir1BWZWC4BpcA6/Ucno6 S1NCgPNW4wGd7S1T20ZOSVBxN1on3pgAwOFPCiS9sOhNTl/obSF1q776z/ELWid7AW7F Y4/k3/yLu2XlQoij+aRF7Ar6hH6mbC5RJtEGv7oWyPW5E7YWzDqs3NUusT5YvKcjOfL2 FFPQ== X-Gm-Message-State: ALoCoQlzh7tHrsThLfwPJafpg2zt/WeKdJ0+mOUhbwzKbFGijemAInnhvNMHpvFT907UsSyS/0uX X-Received: by 10.52.145.161 with SMTP id sv1mr3612071vdb.7.1407470746422; Thu, 07 Aug 2014 21:05:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.8 with SMTP id c8ls392063qgc.37.gmail; Thu, 07 Aug 2014 21:05:46 -0700 (PDT) X-Received: by 10.221.61.5 with SMTP id wu5mr1591732vcb.13.1407470746351; Thu, 07 Aug 2014 21:05:46 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id cf1si2486133vdc.84.2014.08.07.21.05.46 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Aug 2014 21:05:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.181 as permitted sender) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf12so7529014vcb.26 for ; Thu, 07 Aug 2014 21:05:46 -0700 (PDT) X-Received: by 10.52.243.10 with SMTP id wu10mr5077505vdc.45.1407470746267; Thu, 07 Aug 2014 21:05:46 -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 tc5csp87282vcb; Thu, 7 Aug 2014 21:05:45 -0700 (PDT) X-Received: by 10.66.141.109 with SMTP id rn13mr22025084pab.117.1407470745206; Thu, 07 Aug 2014 21:05:45 -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.44 for ; Thu, 07 Aug 2014 21:05:45 -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 S1752787AbaHHEFo (ORCPT + 4 others); Fri, 8 Aug 2014 00:05:44 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:45331 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbaHHEFn (ORCPT ); Fri, 8 Aug 2014 00:05:43 -0400 Received: by mail-pd0-f173.google.com with SMTP id w10so6323965pde.18 for ; Thu, 07 Aug 2014 21:05:43 -0700 (PDT) X-Received: by 10.70.92.81 with SMTP id ck17mr21531533pdb.2.1407470743205; Thu, 07 Aug 2014 21:05:43 -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.41 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Aug 2014 21:05:42 -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 06/13] qcom: msm-pm: Add support for hotplug and secondary startup Date: Thu, 7 Aug 2014 22:05:15 -0600 Message-Id: <1407470722-23015-7-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.181 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 */