aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/cpu.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2020-03-27 12:06:44 +0100
committerThomas Gleixner <tglx@linutronix.de>2020-03-28 11:42:55 +0100
commite98eac6ff1b45e4e73f2e6031b37c256ccb5d36b (patch)
tree1252ed7d0059e070795e9e4e5d8d6ac06b1cee46 /include/linux/cpu.h
parentcpu/hotplug: Hide cpu_up/down() (diff)
downloadwireguard-linux-e98eac6ff1b45e4e73f2e6031b37c256ccb5d36b.tar.xz
wireguard-linux-e98eac6ff1b45e4e73f2e6031b37c256ccb5d36b.zip
cpu/hotplug: Ignore pm_wakeup_pending() for disable_nonboot_cpus()
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. Fixes: a66d955e910a ("cpu/hotplug: Abort disabling secondary CPUs if wakeup is pending") Reported-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Pavankumar Kondeti <pkondeti@codeaurora.org> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/874kuaxdiz.fsf@nanos.tec.linutronix.de
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r--include/linux/cpu.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 9ead281157d3..beaed2dc269e 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -144,12 +144,18 @@ static inline void get_online_cpus(void) { cpus_read_lock(); }
static inline void put_online_cpus(void) { cpus_read_unlock(); }
#ifdef CONFIG_PM_SLEEP_SMP
-extern int freeze_secondary_cpus(int primary);
+int __freeze_secondary_cpus(int primary, bool suspend);
+static inline int freeze_secondary_cpus(int primary)
+{
+ return __freeze_secondary_cpus(primary, true);
+}
+
static inline int disable_nonboot_cpus(void)
{
- return freeze_secondary_cpus(0);
+ return __freeze_secondary_cpus(0, false);
}
-extern void enable_nonboot_cpus(void);
+
+void enable_nonboot_cpus(void);
static inline int suspend_disable_secondary_cpus(void)
{