]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.1.13/arm64-kernel-rename-__cpu_suspend-to-keep-it-aligned-with-arm.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.1.13 / arm64-kernel-rename-__cpu_suspend-to-keep-it-aligned-with-arm.patch
1 From af391b15f7b56ce19f52862d36595637dd42b575 Mon Sep 17 00:00:00 2001
2 From: Sudeep Holla <sudeep.holla@arm.com>
3 Date: Thu, 18 Jun 2015 15:41:32 +0100
4 Subject: arm64: kernel: rename __cpu_suspend to keep it aligned with arm
5
6 From: Sudeep Holla <sudeep.holla@arm.com>
7
8 commit af391b15f7b56ce19f52862d36595637dd42b575 upstream.
9
10 This patch renames __cpu_suspend to cpu_suspend so that it's aligned
11 with ARM32. It also removes the redundant wrapper created.
12
13 This is in preparation to implement generic PSCI system suspend using
14 the cpu_{suspend,resume} which now has the same interface on both ARM
15 and ARM64.
16
17 Cc: Mark Rutland <mark.rutland@arm.com>
18 Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
19 Reviewed-by: Ashwin Chaugule <ashwin.chaugule@linaro.org>
20 Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
21 Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 arch/arm64/include/asm/cpuidle.h | 8 ++------
26 arch/arm64/include/asm/suspend.h | 2 +-
27 arch/arm64/kernel/cpuidle.c | 4 ++--
28 arch/arm64/kernel/psci.c | 2 +-
29 arch/arm64/kernel/suspend.c | 6 +++---
30 5 files changed, 9 insertions(+), 13 deletions(-)
31
32 --- a/arch/arm64/include/asm/cpuidle.h
33 +++ b/arch/arm64/include/asm/cpuidle.h
34 @@ -5,20 +5,16 @@
35
36 #ifdef CONFIG_CPU_IDLE
37 extern int arm_cpuidle_init(unsigned int cpu);
38 -extern int cpu_suspend(unsigned long arg);
39 +extern int arm_cpuidle_suspend(int index);
40 #else
41 static inline int arm_cpuidle_init(unsigned int cpu)
42 {
43 return -EOPNOTSUPP;
44 }
45
46 -static inline int cpu_suspend(unsigned long arg)
47 +static inline int arm_cpuidle_suspend(int index)
48 {
49 return -EOPNOTSUPP;
50 }
51 #endif
52 -static inline int arm_cpuidle_suspend(int index)
53 -{
54 - return cpu_suspend(index);
55 -}
56 #endif
57 --- a/arch/arm64/include/asm/suspend.h
58 +++ b/arch/arm64/include/asm/suspend.h
59 @@ -21,6 +21,6 @@ struct sleep_save_sp {
60 phys_addr_t save_ptr_stash_phys;
61 };
62
63 -extern int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
64 +extern int cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
65 extern void cpu_resume(void);
66 #endif
67 --- a/arch/arm64/kernel/cpuidle.c
68 +++ b/arch/arm64/kernel/cpuidle.c
69 @@ -37,7 +37,7 @@ int arm_cpuidle_init(unsigned int cpu)
70 * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU
71 * operations back-end error code otherwise.
72 */
73 -int cpu_suspend(unsigned long arg)
74 +int arm_cpuidle_suspend(int index)
75 {
76 int cpu = smp_processor_id();
77
78 @@ -47,5 +47,5 @@ int cpu_suspend(unsigned long arg)
79 */
80 if (!cpu_ops[cpu] || !cpu_ops[cpu]->cpu_suspend)
81 return -EOPNOTSUPP;
82 - return cpu_ops[cpu]->cpu_suspend(arg);
83 + return cpu_ops[cpu]->cpu_suspend(index);
84 }
85 --- a/arch/arm64/kernel/psci.c
86 +++ b/arch/arm64/kernel/psci.c
87 @@ -546,7 +546,7 @@ static int __maybe_unused cpu_psci_cpu_s
88 if (state[index - 1].type == PSCI_POWER_STATE_TYPE_STANDBY)
89 ret = psci_ops.cpu_suspend(state[index - 1], 0);
90 else
91 - ret = __cpu_suspend(index, psci_suspend_finisher);
92 + ret = cpu_suspend(index, psci_suspend_finisher);
93
94 return ret;
95 }
96 --- a/arch/arm64/kernel/suspend.c
97 +++ b/arch/arm64/kernel/suspend.c
98 @@ -51,13 +51,13 @@ void __init cpu_suspend_set_dbg_restorer
99 }
100
101 /*
102 - * __cpu_suspend
103 + * cpu_suspend
104 *
105 * arg: argument to pass to the finisher function
106 * fn: finisher function pointer
107 *
108 */
109 -int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
110 +int cpu_suspend(unsigned long arg, int (*fn)(unsigned long))
111 {
112 struct mm_struct *mm = current->active_mm;
113 int ret;
114 @@ -82,7 +82,7 @@ int __cpu_suspend(unsigned long arg, int
115 * We are resuming from reset with TTBR0_EL1 set to the
116 * idmap to enable the MMU; restore the active_mm mappings in
117 * TTBR0_EL1 unless the active_mm == &init_mm, in which case
118 - * the thread entered __cpu_suspend with TTBR0_EL1 set to
119 + * the thread entered cpu_suspend with TTBR0_EL1 set to
120 * reserved TTBR0 page tables and should be restored as such.
121 */
122 if (mm == &init_mm)