aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/include
diff options
context:
space:
mode:
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2015-01-26 13:33:44 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2015-01-27 06:35:33 -0500
commitaf3cfdbf56b91785650f54e7c9a899d814b4b9fb (patch)
treed3f8f97239085af0b605ad945812ac198f3d18ca /arch/arm64/include
parentc623b33b4e9599c6ac5076f7db7369eb9869aa04 (diff)
arm64: kernel: remove ARM64_CPU_SUSPEND config option
ARM64_CPU_SUSPEND config option was introduced to make code providing context save/restore selectable only on platforms requiring power management capabilities. Currently ARM64_CPU_SUSPEND depends on the PM_SLEEP config option which in turn is set by the SUSPEND config option. The introduction of CPU_IDLE for arm64 requires that code configured by ARM64_CPU_SUSPEND (context save/restore) should be compiled in in order to enable the CPU idle driver to rely on CPU operations carrying out context save/restore. The ARM64_CPUIDLE config option (ARM64 generic idle driver) is therefore forced to select ARM64_CPU_SUSPEND, even if there may be (ie PM_SLEEP) failed dependencies, which is not a clean way of handling the kernel configuration option. For these reasons, this patch removes the ARM64_CPU_SUSPEND config option and makes the context save/restore dependent on CPU_PM, which is selected whenever either SUSPEND or CPU_IDLE are configured, cleaning up dependencies in the process. This way, code previously configured through ARM64_CPU_SUSPEND is compiled in whenever a power management subsystem requires it to be present in the kernel (SUSPEND || CPU_IDLE), which is the behaviour expected on ARM64 kernels. The cpu_suspend and cpu_init_idle CPU operations are added only if CPU_IDLE is selected, since they are CPU_IDLE specific methods and should be grouped and defined accordingly. PSCI CPU operations are updated to reflect the introduced changes. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Will Deacon <will.deacon@arm.com> Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Mark Rutland <mark.rutland@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r--arch/arm64/include/asm/cpu_ops.h8
-rw-r--r--arch/arm64/include/asm/cpuidle.h6
-rw-r--r--arch/arm64/include/asm/suspend.h2
3 files changed, 10 insertions, 6 deletions
diff --git a/arch/arm64/include/asm/cpu_ops.h b/arch/arm64/include/asm/cpu_ops.h
index 6f8e2ef9094a..da301ee7395c 100644
--- a/arch/arm64/include/asm/cpu_ops.h
+++ b/arch/arm64/include/asm/cpu_ops.h
@@ -28,8 +28,6 @@ struct device_node;
28 * enable-method property. 28 * enable-method property.
29 * @cpu_init: Reads any data necessary for a specific enable-method from the 29 * @cpu_init: Reads any data necessary for a specific enable-method from the
30 * devicetree, for a given cpu node and proposed logical id. 30 * devicetree, for a given cpu node and proposed logical id.
31 * @cpu_init_idle: Reads any data necessary to initialize CPU idle states from
32 * devicetree, for a given cpu node and proposed logical id.
33 * @cpu_prepare: Early one-time preparation step for a cpu. If there is a 31 * @cpu_prepare: Early one-time preparation step for a cpu. If there is a
34 * mechanism for doing so, tests whether it is possible to boot 32 * mechanism for doing so, tests whether it is possible to boot
35 * the given CPU. 33 * the given CPU.
@@ -42,6 +40,8 @@ struct device_node;
42 * @cpu_die: Makes a cpu leave the kernel. Must not fail. Called from the 40 * @cpu_die: Makes a cpu leave the kernel. Must not fail. Called from the
43 * cpu being killed. 41 * cpu being killed.
44 * @cpu_kill: Ensures a cpu has left the kernel. Called from another cpu. 42 * @cpu_kill: Ensures a cpu has left the kernel. Called from another cpu.
43 * @cpu_init_idle: Reads any data necessary to initialize CPU idle states from
44 * devicetree, for a given cpu node and proposed logical id.
45 * @cpu_suspend: Suspends a cpu and saves the required context. May fail owing 45 * @cpu_suspend: Suspends a cpu and saves the required context. May fail owing
46 * to wrong parameters or error conditions. Called from the 46 * to wrong parameters or error conditions. Called from the
47 * CPU being suspended. Must be called with IRQs disabled. 47 * CPU being suspended. Must be called with IRQs disabled.
@@ -49,7 +49,6 @@ struct device_node;
49struct cpu_operations { 49struct cpu_operations {
50 const char *name; 50 const char *name;
51 int (*cpu_init)(struct device_node *, unsigned int); 51 int (*cpu_init)(struct device_node *, unsigned int);
52 int (*cpu_init_idle)(struct device_node *, unsigned int);
53 int (*cpu_prepare)(unsigned int); 52 int (*cpu_prepare)(unsigned int);
54 int (*cpu_boot)(unsigned int); 53 int (*cpu_boot)(unsigned int);
55 void (*cpu_postboot)(void); 54 void (*cpu_postboot)(void);
@@ -58,7 +57,8 @@ struct cpu_operations {
58 void (*cpu_die)(unsigned int cpu); 57 void (*cpu_die)(unsigned int cpu);
59 int (*cpu_kill)(unsigned int cpu); 58 int (*cpu_kill)(unsigned int cpu);
60#endif 59#endif
61#ifdef CONFIG_ARM64_CPU_SUSPEND 60#ifdef CONFIG_CPU_IDLE
61 int (*cpu_init_idle)(struct device_node *, unsigned int);
62 int (*cpu_suspend)(unsigned long); 62 int (*cpu_suspend)(unsigned long);
63#endif 63#endif
64}; 64};
diff --git a/arch/arm64/include/asm/cpuidle.h b/arch/arm64/include/asm/cpuidle.h
index b52a9932e2b1..0710654631e7 100644
--- a/arch/arm64/include/asm/cpuidle.h
+++ b/arch/arm64/include/asm/cpuidle.h
@@ -3,11 +3,17 @@
3 3
4#ifdef CONFIG_CPU_IDLE 4#ifdef CONFIG_CPU_IDLE
5extern int cpu_init_idle(unsigned int cpu); 5extern int cpu_init_idle(unsigned int cpu);
6extern int cpu_suspend(unsigned long arg);
6#else 7#else
7static inline int cpu_init_idle(unsigned int cpu) 8static inline int cpu_init_idle(unsigned int cpu)
8{ 9{
9 return -EOPNOTSUPP; 10 return -EOPNOTSUPP;
10} 11}
12
13static inline int cpu_suspend(unsigned long arg)
14{
15 return -EOPNOTSUPP;
16}
11#endif 17#endif
12 18
13#endif 19#endif
diff --git a/arch/arm64/include/asm/suspend.h b/arch/arm64/include/asm/suspend.h
index 456d67c1f0fa..003802f58963 100644
--- a/arch/arm64/include/asm/suspend.h
+++ b/arch/arm64/include/asm/suspend.h
@@ -23,6 +23,4 @@ struct sleep_save_sp {
23 23
24extern int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long)); 24extern int __cpu_suspend(unsigned long arg, int (*fn)(unsigned long));
25extern void cpu_resume(void); 25extern void cpu_resume(void);
26extern int cpu_suspend(unsigned long);
27
28#endif 26#endif