A recent change to freeze_secondary_cpus() which added an early abort if a wakeup is pending missed the fact that the function is also invoked for shutdown, reboot and kexec via disable_nonboot_cpus(). In case of disable_nonboot_cpus() the wakeup event needs to be ignored as the purpose is to terminate the currently running kernel. Add a 'suspend' argument which is only set when the freeze is in context of a suspend operation. If not set then an eventually pending wakeup event is ignored.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -144,12 +144,18 @@ static inline void get_online_cpus(void) { cpus_read_lock(); } · 143 unmodified lines | |||
| 144 | static inline void put_online_cpus(void) { cpus_read_unlock(); } | 144 | static inline void put_online_cpus(void) { cpus_read_unlock(); } |
| 145 | 145 | ||
| 146 | #ifdef CONFIG_PM_SLEEP_SMP | 146 | #ifdef CONFIG_PM_SLEEP_SMP |
| 147 | extern int freeze_secondary_cpus(int primary); | 147 | int __freeze_secondary_cpus(int primary, bool suspend); |
| 148 | static inline int freeze_secondary_cpus(int primary) | ||
| 149 | { | ||
| 150 | return __freeze_secondary_cpus(primary, true); | ||
| 151 | } | ||
| 152 | |||
| 148 | static inline int disable_nonboot_cpus(void) | 153 | static inline int disable_nonboot_cpus(void) |
| 149 | { | 154 | { |
| 150 | return freeze_secondary_cpus(0); | 155 | return __freeze_secondary_cpus(0, false); |
| 151 | } | 156 | } |
| 152 | extern void enable_nonboot_cpus(void); | 157 | |
| 158 | void enable_nonboot_cpus(void); | ||
| 153 | 159 | ||
| 154 | static inline int suspend_disable_secondary_cpus(void) | 160 | static inline int suspend_disable_secondary_cpus(void) |
| 155 | { | 161 | { |