aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2015-12-17 05:22:45 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-12-22 07:09:43 -0500
commitf6419f240b15f967713c5cd6857dfba8fb390589 (patch)
tree7c7f80499fcf085da3ccdd592a84808feb9eab9d
parent42f25bddd0a226d2431e057b9e01c5cc61067e12 (diff)
ARM: 8485/1: cpuidle: remove cpu parameter from the cpuidle_ops suspend hook
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 <lorenzo.pieralisi@arm.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> Reviewed-by: Lina Iyer <lina.iyer@linaro.org> Tested-by: Lina Iyer <lina.iyer@linaro.org> Tested-by: Jisheng Zhang <jszhang@marvell.com> [psci] Cc: Lina Iyer <lina.iyer@linaro.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/include/asm/cpuidle.h2
-rw-r--r--arch/arm/kernel/cpuidle.c2
-rw-r--r--drivers/soc/qcom/spm.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h
index 0f8424924902..3848259bebf8 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,
30struct device_node; 30struct device_node;
31 31
32struct cpuidle_ops { 32struct cpuidle_ops {
33 int (*suspend)(int cpu, unsigned long arg); 33 int (*suspend)(unsigned long arg);
34 int (*init)(struct device_node *, int cpu); 34 int (*init)(struct device_node *, int cpu);
35}; 35};
36 36
diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c
index 318da33465f4..703926e7007b 100644
--- a/arch/arm/kernel/cpuidle.c
+++ b/arch/arm/kernel/cpuidle.c
@@ -56,7 +56,7 @@ int arm_cpuidle_suspend(int index)
56 int cpu = smp_processor_id(); 56 int cpu = smp_processor_id();
57 57
58 if (cpuidle_ops[cpu].suspend) 58 if (cpuidle_ops[cpu].suspend)
59 ret = cpuidle_ops[cpu].suspend(cpu, index); 59 ret = cpuidle_ops[cpu].suspend(index);
60 60
61 return ret; 61 return ret;
62} 62}
diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c
index b04b05a0904e..0ad66fa9bb1a 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 = {
116 116
117static DEFINE_PER_CPU(struct spm_driver_data *, cpu_spm_drv); 117static DEFINE_PER_CPU(struct spm_driver_data *, cpu_spm_drv);
118 118
119typedef int (*idle_fn)(int); 119typedef int (*idle_fn)(void);
120static DEFINE_PER_CPU(idle_fn*, qcom_idle_ops); 120static DEFINE_PER_CPU(idle_fn*, qcom_idle_ops);
121 121
122static inline void spm_register_write(struct spm_driver_data *drv, 122static inline void spm_register_write(struct spm_driver_data *drv,
@@ -179,10 +179,10 @@ static int qcom_pm_collapse(unsigned long int unused)
179 return -1; 179 return -1;
180} 180}
181 181
182static int qcom_cpu_spc(int cpu) 182static int qcom_cpu_spc(void)
183{ 183{
184 int ret; 184 int ret;
185 struct spm_driver_data *drv = per_cpu(cpu_spm_drv, cpu); 185 struct spm_driver_data *drv = __this_cpu_read(cpu_spm_drv);
186 186
187 spm_set_low_power_mode(drv, PM_SLEEP_MODE_SPC); 187 spm_set_low_power_mode(drv, PM_SLEEP_MODE_SPC);
188 ret = cpu_suspend(0, qcom_pm_collapse); 188 ret = cpu_suspend(0, qcom_pm_collapse);
@@ -197,9 +197,9 @@ static int qcom_cpu_spc(int cpu)
197 return ret; 197 return ret;
198} 198}
199 199
200static int qcom_idle_enter(int cpu, unsigned long index) 200static int qcom_idle_enter(unsigned long index)
201{ 201{
202 return per_cpu(qcom_idle_ops, cpu)[index](cpu); 202 return __this_cpu_read(qcom_idle_ops)[index]();
203} 203}
204 204
205static const struct of_device_id qcom_idle_state_match[] __initconst = { 205static const struct of_device_id qcom_idle_state_match[] __initconst = {