Commit af391b15 authored by Sudeep Holla's avatar Sudeep Holla Committed by Catalin Marinas

arm64: kernel: rename __cpu_suspend to keep it aligned with arm

This patch renames __cpu_suspend to cpu_suspend so that it's aligned
with ARM32. It also removes the redundant wrapper created.

This is in preparation to implement generic PSCI system suspend using
the cpu_{suspend,resume} which now has the same interface on both ARM
and ARM64.

Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: default avatarAshwin Chaugule <ashwin.chaugule@linaro.org>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 4e2ee96a
...@@ -5,20 +5,16 @@ ...@@ -5,20 +5,16 @@
#ifdef CONFIG_CPU_IDLE #ifdef CONFIG_CPU_IDLE
extern int arm_cpuidle_init(unsigned int cpu); extern int arm_cpuidle_init(unsigned int cpu);
extern int cpu_suspend(unsigned long arg); extern int arm_cpuidle_suspend(int index);
#else #else
static inline int arm_cpuidle_init(unsigned int cpu) static inline int arm_cpuidle_init(unsigned int cpu)
{ {
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
static inline int cpu_suspend(unsigned long arg) static inline int arm_cpuidle_suspend(int index)
{ {
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
#endif #endif
static inline int arm_cpuidle_suspend(int index)
{
return cpu_suspend(index);
}
#endif #endif
...@@ -21,6 +21,6 @@ struct sleep_save_sp { ...@@ -21,6 +21,6 @@ struct sleep_save_sp {
phys_addr_t save_ptr_stash_phys; phys_addr_t save_ptr_stash_phys;
}; };
extern int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long)); extern int cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
extern void cpu_resume(void); extern void cpu_resume(void);
#endif #endif
...@@ -32,7 +32,7 @@ int arm_cpuidle_init(unsigned int cpu) ...@@ -32,7 +32,7 @@ int arm_cpuidle_init(unsigned int cpu)
* Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU
* operations back-end error code otherwise. * operations back-end error code otherwise.
*/ */
int cpu_suspend(unsigned long arg) int arm_cpuidle_suspend(int index)
{ {
int cpu = smp_processor_id(); int cpu = smp_processor_id();
...@@ -42,5 +42,5 @@ int cpu_suspend(unsigned long arg) ...@@ -42,5 +42,5 @@ int cpu_suspend(unsigned long arg)
*/ */
if (!cpu_ops[cpu] || !cpu_ops[cpu]->cpu_suspend) if (!cpu_ops[cpu] || !cpu_ops[cpu]->cpu_suspend)
return -EOPNOTSUPP; return -EOPNOTSUPP;
return cpu_ops[cpu]->cpu_suspend(arg); return cpu_ops[cpu]->cpu_suspend(index);
} }
...@@ -574,7 +574,7 @@ static int __maybe_unused cpu_psci_cpu_suspend(unsigned long index) ...@@ -574,7 +574,7 @@ static int __maybe_unused cpu_psci_cpu_suspend(unsigned long index)
if (!psci_power_state_loses_context(state[index - 1])) if (!psci_power_state_loses_context(state[index - 1]))
ret = psci_ops.cpu_suspend(state[index - 1], 0); ret = psci_ops.cpu_suspend(state[index - 1], 0);
else else
ret = __cpu_suspend(index, psci_suspend_finisher); ret = cpu_suspend(index, psci_suspend_finisher);
return ret; return ret;
} }
......
...@@ -51,13 +51,13 @@ void __init cpu_suspend_set_dbg_restorer(void (*hw_bp_restore)(void *)) ...@@ -51,13 +51,13 @@ void __init cpu_suspend_set_dbg_restorer(void (*hw_bp_restore)(void *))
} }
/* /*
* __cpu_suspend * cpu_suspend
* *
* arg: argument to pass to the finisher function * arg: argument to pass to the finisher function
* fn: finisher function pointer * fn: finisher function pointer
* *
*/ */
int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
{ {
struct mm_struct *mm = current->active_mm; struct mm_struct *mm = current->active_mm;
int ret; int ret;
...@@ -82,7 +82,7 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long)) ...@@ -82,7 +82,7 @@ int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
* We are resuming from reset with TTBR0_EL1 set to the * We are resuming from reset with TTBR0_EL1 set to the
* idmap to enable the MMU; restore the active_mm mappings in * idmap to enable the MMU; restore the active_mm mappings in
* TTBR0_EL1 unless the active_mm == &init_mm, in which case * TTBR0_EL1 unless the active_mm == &init_mm, in which case
* the thread entered __cpu_suspend with TTBR0_EL1 set to * the thread entered cpu_suspend with TTBR0_EL1 set to
* reserved TTBR0 page tables and should be restored as such. * reserved TTBR0 page tables and should be restored as such.
*/ */
if (mm == &init_mm) if (mm == &init_mm)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment