From patchwork Fri Apr 17 23:49:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 47303 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BBBCE20553 for ; Fri, 17 Apr 2015 23:49:28 +0000 (UTC) Received: by wgin8 with SMTP id n8sf27386172wgi.0 for ; Fri, 17 Apr 2015 16:49:28 -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=BxE4j5PqvR7ngWeaz40QAYZA7gvRbqTcPLYK57M3/QI=; b=NK8v6CRshmT6dYaWVWTstADJIx7LjkSz23NH+YLgSMK2BhOVS/MGepA9G4SreV5do5 w+kcq+P93Kjp7JpwTmg1XF71AI7qB6JBSK+MTKIEoDHVBo9qxnHO5a5ZtIlTG/Nc2Mze MKazJv0gAHSYn85QgaTyiQvOWjJezJDqFT1uLM+IrY5lMhylXev+GfdD3baSk5tSExgd Ac9uV6PIVQK+VKBYilsPsB4NTQADWjld1O1Rf2XP3EUw+uWE68M/Z0JsJ1HkpqJmQdbt 9X17ZviL4fWHHIxDXFH98bakCu6T7KcYrtWaxMUj+BVBVQT3cqSIa3WtAjMlkWfvcf0l BOkg== X-Gm-Message-State: ALoCoQnMpQNOV3JLlQtinHqXc4nZqBej5bDPPGt9OlZkLQQ6LGKg5Xoxz6AtwZoMT5vf+2U2ln81 X-Received: by 10.194.121.67 with SMTP id li3mr1351687wjb.3.1429314568092; Fri, 17 Apr 2015 16:49:28 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.5.2 with SMTP id ci2ls570153lad.38.gmail; Fri, 17 Apr 2015 16:49:27 -0700 (PDT) X-Received: by 10.152.87.46 with SMTP id u14mr6347255laz.82.1429314567929; Fri, 17 Apr 2015 16:49:27 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id dz10si9836628lac.34.2015.04.17.16.49.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Apr 2015 16:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by lbcga7 with SMTP id ga7so94446698lbc.1 for ; Fri, 17 Apr 2015 16:49:27 -0700 (PDT) X-Received: by 10.152.5.72 with SMTP id q8mr6297048laq.73.1429314567839; Fri, 17 Apr 2015 16:49:27 -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.112.67.65 with SMTP id l1csp262449lbt; Fri, 17 Apr 2015 16:49:27 -0700 (PDT) X-Received: by 10.68.57.143 with SMTP id i15mr9643394pbq.9.1429314564627; Fri, 17 Apr 2015 16:49:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id by2si18511564pbb.237.2015.04.17.16.49.23; Fri, 17 Apr 2015 16:49:24 -0700 (PDT) Received-SPF: none (google.com: linux-pm-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 S1751703AbbDQXtW (ORCPT + 11 others); Fri, 17 Apr 2015 19:49:22 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:33539 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751816AbbDQXtW (ORCPT ); Fri, 17 Apr 2015 19:49:22 -0400 Received: by paboj16 with SMTP id oj16so140449965pab.0 for ; Fri, 17 Apr 2015 16:49:21 -0700 (PDT) X-Received: by 10.70.136.106 with SMTP id pz10mr9468446pdb.105.1429314561636; Fri, 17 Apr 2015 16:49:21 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by mx.google.com with ESMTPSA id hv7sm11157144pdb.86.2015.04.17.16.49.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Apr 2015 16:49:20 -0700 (PDT) From: Lina Iyer To: arnd@arndb.de, catalin.marinas@arm.com, mark.rutland@arm.com, Will.Deacon@arm.com, lorenzo.pieralisi@arm.com Cc: daniel.lezcano@linaro.org, khilman@linaro.org, sboyd@codeaurora.org, galak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, msivasub@codeaurora.org, agross@codeaurora.org, mlocke@codeaurora.org, bryanh@codeaurora.org, Lina Iyer Subject: [PATCH RFC 1/7] arm: Modify cpuidle_ops structures to match ARM64 Date: Fri, 17 Apr 2015 17:49:03 -0600 Message-Id: <1429314549-6730-2-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1429314549-6730-1-git-send-email-lina.iyer@linaro.org> References: <1429314549-6730-1-git-send-email-lina.iyer@linaro.org> Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@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.217.180 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: , SoC's tend to reuse the same hardware block for both ARM and ARM64 based cpus. As such the idle setup and enter functions are generally common. Using the same arguments as cpu_operations for cpuidle callbacks, allow reuse of the same driver for many SoCs. Signed-off-by: Lina Iyer --- arch/arm/include/asm/cpuidle.h | 4 ++-- arch/arm/kernel/cpuidle.c | 2 +- drivers/soc/qcom/spm.c | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h index 0f84249..08768da 100644 --- a/arch/arm/include/asm/cpuidle.h +++ b/arch/arm/include/asm/cpuidle.h @@ -30,8 +30,8 @@ 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 (*init)(struct device_node *, int cpu); + int (*suspend)(unsigned long arg); + int (*init)(struct device_node *, unsigned int cpu); }; struct of_cpuidle_method { 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 b562af8..5d0dd8c 100644 --- a/drivers/soc/qcom/spm.c +++ b/drivers/soc/qcom/spm.c @@ -197,8 +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) { + int cpu = smp_processor_id(); return per_cpu(qcom_idle_ops, cpu)[index](cpu); } @@ -207,7 +208,7 @@ static const struct of_device_id qcom_idle_state_match[] __initconst = { { }, }; -static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu) +static int __init qcom_cpuidle_init(struct device_node *cpu_node, u32 cpu) { const struct of_device_id *match_id; struct device_node *state_node;