diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2006-09-26 02:32:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:59 -0400 |
commit | e3920fb42c8ddfe63befb54d95c0e13eabacea9b (patch) | |
tree | 08371a71e58e6e9d3ec62dfa6a22b3b5e6ff0fd5 /include | |
parent | e8eff5ac294e12531c4195e0c15a222d3c9015e5 (diff) |
[PATCH] Disable CPU hotplug during suspend
The current suspend code has to be run on one CPU, so we use the CPU
hotplug to take the non-boot CPUs offline on SMP machines. However, we
should also make sure that these CPUs will not be enabled by someone else
after we have disabled them.
The functions disable_nonboot_cpus() and enable_nonboot_cpus() are moved to
kernel/cpu.c, because they now refer to some stuff in there that should
better be static. Also it's better if disable_nonboot_cpus() returns an
error instead of panicking if something goes wrong, and
enable_nonboot_cpus() has no reason to panic(), because the CPUs may have
been enabled by the userland before it tries to take them online.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpu.h | 8 | ||||
-rw-r--r-- | include/linux/suspend.h | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 8fb344a9abd8..3fef7d67aedc 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -89,4 +89,12 @@ int cpu_down(unsigned int cpu); | |||
89 | static inline int cpu_is_offline(int cpu) { return 0; } | 89 | static inline int cpu_is_offline(int cpu) { return 0; } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | #ifdef CONFIG_SUSPEND_SMP | ||
93 | extern int disable_nonboot_cpus(void); | ||
94 | extern void enable_nonboot_cpus(void); | ||
95 | #else | ||
96 | static inline int disable_nonboot_cpus(void) { return 0; } | ||
97 | static inline void enable_nonboot_cpus(void) {} | ||
98 | #endif | ||
99 | |||
92 | #endif /* _LINUX_CPU_H_ */ | 100 | #endif /* _LINUX_CPU_H_ */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 96e31aa64cc7..6e8a06c950f4 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -57,14 +57,6 @@ static inline int software_suspend(void) | |||
57 | } | 57 | } |
58 | #endif /* CONFIG_PM */ | 58 | #endif /* CONFIG_PM */ |
59 | 59 | ||
60 | #ifdef CONFIG_SUSPEND_SMP | ||
61 | extern void disable_nonboot_cpus(void); | ||
62 | extern void enable_nonboot_cpus(void); | ||
63 | #else | ||
64 | static inline void disable_nonboot_cpus(void) {} | ||
65 | static inline void enable_nonboot_cpus(void) {} | ||
66 | #endif | ||
67 | |||
68 | void save_processor_state(void); | 60 | void save_processor_state(void); |
69 | void restore_processor_state(void); | 61 | void restore_processor_state(void); |
70 | struct saved_context; | 62 | struct saved_context; |