From patchwork Tue Nov 17 22:37:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 7643221 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 84C72BF90C for ; Tue, 17 Nov 2015 22:42:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E29E20494 for ; Tue, 17 Nov 2015 22:42:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A101620437 for ; Tue, 17 Nov 2015 22:42:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZyovQ-0007jb-Gb; Tue, 17 Nov 2015 22:40:32 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zyotu-0005YP-H8 for linux-arm-kernel@lists.infradead.org; Tue, 17 Nov 2015 22:39:00 +0000 Received: by pacej9 with SMTP id ej9so22072824pac.2 for ; Tue, 17 Nov 2015 14:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro_org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3WAUN/cmGa2B2V5zB5kKCzWpOuCfDwZapmn7cs9Z7Ak=; b=gCuhoEwGW8xRP1IuUuCJTqnZYaIUR9dpYkB8vW1c4p7Es5noICyRF8Ji0x8D29pWNV pV29o/5png+d1ZtlLJshcC+zG9HY1ffxWpS674ew49OW3b2OMqwsg+CljOEpe4pyMIG5 /Xs6zpm7nHdzdifeJXUMsAZlKKdHvhypNqlyK/ZhyBcOP8Q0xJa6UMWnIWKbP0PQG4mG vx1Vv3JX393E1kJvMfDdUep4iTKOmCVV7wXe9rzqtnJ8TT6dGWRPpZm8nau//Pvnnc1j 6lscygPKbhASA26HzQvalzcw7hHK93Yo+lfmWZWM3d8URO8RXkhfQVPiNd8SYy1jT6gC X1fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=3WAUN/cmGa2B2V5zB5kKCzWpOuCfDwZapmn7cs9Z7Ak=; b=R/0GFJW/W4MJxcEHTjl/rvlH9D4Pq+LaFYFEba1FKE+ssgrOp9wFNCmfW/Wr5S+GWA 78nylVy39I+3e9Zcw+Ecuj/50OEeT/9aKxVTgDcUUsXD7nWu66rXemybVj04zR50egM6 H9/BgQTLofXQG3NZ3Ol7025ffUDlt/zKjzI4W8kFeYWswUHdmprkMd56JBtbl5tGRbIi RPW08eBpVCDtSnMUcBpF4z3Xp7iKZ38glq1x8pR8ZlFmcVQriqG+RMTkvj2GE+G3mJs9 ZFOmRopFYUn73xu7Ryphj01WXOEkSQqWDS/n6F2qurr4JqcPHu5JfC3eGaq46MTScfaE mFUA== X-Gm-Message-State: ALoCoQmORDfjHlU4rknyjaPBon/Pg28mYEA/iuO+RlzVS/0/8osuxqSSmM6ifvmUgLqh9TnGnQQh X-Received: by 10.68.204.226 with SMTP id lb2mr66442663pbc.151.1447799920819; Tue, 17 Nov 2015 14:38:40 -0800 (PST) Received: from ubuntu.localdomain ([8.42.77.226]) by smtp.gmail.com with ESMTPSA id hy1sm14875199pbb.63.2015.11.17.14.38.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Nov 2015 14:38:39 -0800 (PST) From: Lina Iyer To: ulf.hansson@linaro.org, khilman@linaro.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC 12/27] ARM: cpuidle: remove cpu parameter from the cpuidle_ops suspend hook Date: Tue, 17 Nov 2015 15:37:36 -0700 Message-Id: <1447799871-56374-13-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> References: <1447799871-56374-1-git-send-email-lina.iyer@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151117_143858_757574_719761D3 X-CRM114-Status: GOOD ( 17.13 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, lorenzo.pieralisi@arm.com, Russell King , ahaslam@baylibre.com, linux-arm-msm@vger.kernel.org, Daniel Lezcano , sboyd@codeaurora.org, msivasub@codeaurora.org, geert@linux-m68k.org, Lina Iyer , agross@codeaurora.org, mtitinger@baylibre.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lorenzo Pieralisi The suspend() hook in the cpuidle_ops struct is always called on the cpu entering idle, which means that the cpu parameter passed to the suspend hook always corresponds to the local cpu, making it somewhat redundant. This patch removes the logical cpu parameter from the ARM cpuidle_ops.suspend hook and updates all the existing kernel implementations to reflect this change. Signed-off-by: Lorenzo Pieralisi Cc: Lina Iyer Cc: Russell King Cc: Daniel Lezcano --- arch/arm/include/asm/cpuidle.h | 2 +- arch/arm/kernel/cpuidle.c | 2 +- drivers/soc/qcom/spm.c | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h index 0f84249..3848259 100644 --- a/arch/arm/include/asm/cpuidle.h +++ b/arch/arm/include/asm/cpuidle.h @@ -30,7 +30,7 @@ static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev, struct device_node; struct cpuidle_ops { - int (*suspend)(int cpu, unsigned long arg); + int (*suspend)(unsigned long arg); int (*init)(struct device_node *, int cpu); }; diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c index 318da33..703926e 100644 --- a/arch/arm/kernel/cpuidle.c +++ b/arch/arm/kernel/cpuidle.c @@ -56,7 +56,7 @@ int arm_cpuidle_suspend(int index) int cpu = smp_processor_id(); if (cpuidle_ops[cpu].suspend) - ret = cpuidle_ops[cpu].suspend(cpu, index); + ret = cpuidle_ops[cpu].suspend(index); return ret; } diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index b04b05a..0ad66fa 100644 --- a/drivers/soc/qcom/spm.c +++ b/drivers/soc/qcom/spm.c @@ -116,7 +116,7 @@ static const struct spm_reg_data spm_reg_8064_cpu = { static DEFINE_PER_CPU(struct spm_driver_data *, cpu_spm_drv); -typedef int (*idle_fn)(int); +typedef int (*idle_fn)(void); static DEFINE_PER_CPU(idle_fn*, qcom_idle_ops); static inline void spm_register_write(struct spm_driver_data *drv, @@ -179,10 +179,10 @@ static int qcom_pm_collapse(unsigned long int unused) return -1; } -static int qcom_cpu_spc(int cpu) +static int qcom_cpu_spc(void) { int ret; - struct spm_driver_data *drv = per_cpu(cpu_spm_drv, cpu); + struct spm_driver_data *drv = __this_cpu_read(cpu_spm_drv); spm_set_low_power_mode(drv, PM_SLEEP_MODE_SPC); ret = cpu_suspend(0, qcom_pm_collapse); @@ -197,9 +197,9 @@ static int qcom_cpu_spc(int cpu) return ret; } -static int qcom_idle_enter(int cpu, unsigned long index) +static int qcom_idle_enter(unsigned long index) { - return per_cpu(qcom_idle_ops, cpu)[index](cpu); + return __this_cpu_read(qcom_idle_ops)[index](); } static const struct of_device_id qcom_idle_state_match[] __initconst = {