From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> To: linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Lina Iyer <lina.iyer@linaro.org>, Russell King <linux@arm.linux.org.uk>, Daniel Lezcano <daniel.lezcano@linaro.org>, Will Deacon <will.deacon@arm.com>, Sudeep Holla <sudeep.holla@arm.com>, Catalin Marinas <catalin.marinas@arm.com>, Mark Rutland <mark.rutland@arm.com>, Jisheng Zhang <jszhang@marvell.com> Subject: [PATCH 1/2] ARM: cpuidle: make cpuidle_ops interfaces ARM64 compliant Date: Thu, 1 Oct 2015 09:58:52 +0100 [thread overview] Message-ID: <1443689933-28882-2-git-send-email-lorenzo.pieralisi@arm.com> (raw) In-Reply-To: <1443689933-28882-1-git-send-email-lorenzo.pieralisi@arm.com> In preparation for sharing PSCI idle operations on ARM and ARM64, this patch refines the ARM cpuidle_ops interfaces so that the two arches can use the same interfaces seamlessly. Based-on-patch-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Lina Iyer <lina.iyer@linaro.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> --- arch/arm/include/asm/cpuidle.h | 4 ++-- arch/arm/kernel/cpuidle.c | 4 ++-- drivers/soc/qcom/spm.c | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h index 0f84249..ee36dd4 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)(unsigned int cpu); }; struct of_cpuidle_method { diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c index 318da33..a75b7ae 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; } @@ -144,7 +144,7 @@ int __init arm_cpuidle_init(int cpu) ret = arm_cpuidle_read_ops(cpu_node, cpu); if (!ret && cpuidle_ops[cpu].init) - ret = cpuidle_ops[cpu].init(cpu_node, cpu); + ret = cpuidle_ops[cpu].init(cpu); of_node_put(cpu_node); diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index b04b05a..8deaea0 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(unsigned int cpu) { const struct of_device_id *match_id; struct device_node *state_node; @@ -217,6 +218,10 @@ static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu) idle_fn *fns; cpumask_t mask; bool use_scm_power_down = false; + struct device_node *cpu_node = of_get_cpu_node(cpu, NULL); + + if (!cpu_node) + return -ENODEV; for (i = 0; ; i++) { state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); -- 2.5.1
WARNING: multiple messages have this Message-ID (diff)
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] ARM: cpuidle: make cpuidle_ops interfaces ARM64 compliant Date: Thu, 1 Oct 2015 09:58:52 +0100 [thread overview] Message-ID: <1443689933-28882-2-git-send-email-lorenzo.pieralisi@arm.com> (raw) In-Reply-To: <1443689933-28882-1-git-send-email-lorenzo.pieralisi@arm.com> In preparation for sharing PSCI idle operations on ARM and ARM64, this patch refines the ARM cpuidle_ops interfaces so that the two arches can use the same interfaces seamlessly. Based-on-patch-by: Jisheng Zhang <jszhang@marvell.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Lina Iyer <lina.iyer@linaro.org> Cc: Russell King <linux@arm.linux.org.uk> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> --- arch/arm/include/asm/cpuidle.h | 4 ++-- arch/arm/kernel/cpuidle.c | 4 ++-- drivers/soc/qcom/spm.c | 9 +++++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h index 0f84249..ee36dd4 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)(unsigned int cpu); }; struct of_cpuidle_method { diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c index 318da33..a75b7ae 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; } @@ -144,7 +144,7 @@ int __init arm_cpuidle_init(int cpu) ret = arm_cpuidle_read_ops(cpu_node, cpu); if (!ret && cpuidle_ops[cpu].init) - ret = cpuidle_ops[cpu].init(cpu_node, cpu); + ret = cpuidle_ops[cpu].init(cpu); of_node_put(cpu_node); diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index b04b05a..8deaea0 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(unsigned int cpu) { const struct of_device_id *match_id; struct device_node *state_node; @@ -217,6 +218,10 @@ static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu) idle_fn *fns; cpumask_t mask; bool use_scm_power_down = false; + struct device_node *cpu_node = of_get_cpu_node(cpu, NULL); + + if (!cpu_node) + return -ENODEV; for (i = 0; ; i++) { state_node = of_parse_phandle(cpu_node, "cpu-idle-states", i); -- 2.5.1
next prev parent reply other threads:[~2015-10-01 8:58 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-10-01 8:58 [PATCH 0/2] Enabling PSCI based idle on ARM 32-bit platforms Lorenzo Pieralisi 2015-10-01 8:58 ` Lorenzo Pieralisi 2015-10-01 8:58 ` Lorenzo Pieralisi [this message] 2015-10-01 8:58 ` [PATCH 1/2] ARM: cpuidle: make cpuidle_ops interfaces ARM64 compliant Lorenzo Pieralisi 2015-10-02 9:37 ` Daniel Lezcano 2015-10-02 9:37 ` Daniel Lezcano 2015-10-02 10:52 ` Lorenzo Pieralisi 2015-10-02 10:52 ` Lorenzo Pieralisi 2015-10-01 8:58 ` [PATCH 2/2] ARM64: kernel: PSCI: move PSCI idle management code to drivers/firmware Lorenzo Pieralisi 2015-10-01 8:58 ` Lorenzo Pieralisi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1443689933-28882-2-git-send-email-lorenzo.pieralisi@arm.com \ --to=lorenzo.pieralisi@arm.com \ --cc=catalin.marinas@arm.com \ --cc=daniel.lezcano@linaro.org \ --cc=jszhang@marvell.com \ --cc=lina.iyer@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-pm@vger.kernel.org \ --cc=linux@arm.linux.org.uk \ --cc=mark.rutland@arm.com \ --cc=sudeep.holla@arm.com \ --cc=will.deacon@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.