History

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.

Thomas Gleixner committed 6 years ago

Commit e98eac61 parent 33c37362 files · +11 −5Browse files

Showing the changes to kernel (1 of 2 files). Show all

Unified · Split

kernel/cpu.c+2−2
@@ -1327,7 +1327,7 @@ void bringup_nonboot_cpus(unsigned int setup_max_cpus) · 1326 unmodified lines
1327#ifdef CONFIG_PM_SLEEP_SMP1327#ifdef CONFIG_PM_SLEEP_SMP
1328static cpumask_var_t frozen_cpus;1328static cpumask_var_t frozen_cpus;
1329 1329
1330int freeze_secondary_cpus(int primary)1330int __freeze_secondary_cpus(int primary, bool suspend)
1331{1331{
1332 int cpu, error = 0;1332 int cpu, error = 0;
1333 1333
@@ -1352,7 +1352,7 @@ int freeze_secondary_cpus(int primary) · 18 unmodified lines
1352 if (cpu == primary)1352 if (cpu == primary)
1353 continue;1353 continue;
1354 1354
1355 if (pm_wakeup_pending()) {1355 if (suspend && pm_wakeup_pending()) {
1356 pr_info("Wakeup pending. Abort CPU freeze\n");1356 pr_info("Wakeup pending. Abort CPU freeze\n");
1357 error = -EBUSY;1357 error = -EBUSY;
1358 break;1358 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t