Skip to content

Commit 063181a

Browse files
Lorenzo PieralisiAlex Shi
authored andcommitted
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> (cherry picked from commit f6419f240b15f967713c5cd6857dfba8fb390589) Signed-off-by: Alex Shi <alex.shi@linaro.org>
1 parent a501ac0 commit 063181a

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

arch/arm/include/asm/cpuidle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static inline int arm_cpuidle_simple_enter(struct cpuidle_device *dev,
3030
struct device_node;
3131

3232
struct cpuidle_ops {
33-
int (*suspend)(int cpu, unsigned long arg);
33+
int (*suspend)(unsigned long arg);
3434
int (*init)(struct device_node *, int cpu);
3535
};
3636

arch/arm/kernel/cpuidle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int arm_cpuidle_suspend(int index)
5656
int cpu = smp_processor_id();
5757

5858
if (cpuidle_ops[cpu].suspend)
59-
ret = cpuidle_ops[cpu].suspend(cpu, index);
59+
ret = cpuidle_ops[cpu].suspend(index);
6060

6161
return ret;
6262
}

drivers/soc/qcom/spm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static const struct spm_reg_data spm_reg_8064_cpu = {
116116

117117
static DEFINE_PER_CPU(struct spm_driver_data *, cpu_spm_drv);
118118

119-
typedef int (*idle_fn)(int);
119+
typedef int (*idle_fn)(void);
120120
static DEFINE_PER_CPU(idle_fn*, qcom_idle_ops);
121121

122122
static inline void spm_register_write(struct spm_driver_data *drv,
@@ -179,10 +179,10 @@ static int qcom_pm_collapse(unsigned long int unused)
179179
return -1;
180180
}
181181

182-
static int qcom_cpu_spc(int cpu)
182+
static int qcom_cpu_spc(void)
183183
{
184184
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);
186186

187187
spm_set_low_power_mode(drv, PM_SLEEP_MODE_SPC);
188188
ret = cpu_suspend(0, qcom_pm_collapse);
@@ -197,9 +197,9 @@ static int qcom_cpu_spc(int cpu)
197197
return ret;
198198
}
199199

200-
static int qcom_idle_enter(int cpu, unsigned long index)
200+
static int qcom_idle_enter(unsigned long index)
201201
{
202-
return per_cpu(qcom_idle_ops, cpu)[index](cpu);
202+
return __this_cpu_read(qcom_idle_ops)[index]();
203203
}
204204

205205
static const struct of_device_id qcom_idle_state_match[] __initconst = {

0 commit comments

Comments
 (0)