History

cpu/hotplug: Provide bringup_hibernate_cpu()

arm64 uses cpu_up() in the resume from hibernation code to ensure that the CPU on which the system hibernated is online. Provide a core function for this. [ tglx: Split out from the combo arm64 patch ]

Qais Yousef committed 6 years ago

Commit d720f981 parent 5efbe6a2 files · +24 −0Browse files

Unified · Split

2 files
  1. include/linux/cpu.h +1 −0
  2. kernel/cpu.c +23 −0
include/linux/cpu.h+1−0
@@ -93,6 +93,7 @@ int add_cpu(unsigned int cpu); · 92 unmodified lines
93void notify_cpu_starting(unsigned int cpu);93void notify_cpu_starting(unsigned int cpu);
94extern void cpu_maps_update_begin(void);94extern void cpu_maps_update_begin(void);
95extern void cpu_maps_update_done(void);95extern void cpu_maps_update_done(void);
96int bringup_hibernate_cpu(unsigned int sleep_cpu);
96 97
97#else /* CONFIG_SMP */98#else /* CONFIG_SMP */
98#define cpuhp_tasks_frozen 099#define cpuhp_tasks_frozen 0
kernel/cpu.c+23−0
@@ -1275,6 +1275,29 @@ int add_cpu(unsigned int cpu) · 1274 unmodified lines
1275}1275}
1276EXPORT_SYMBOL_GPL(add_cpu);1276EXPORT_SYMBOL_GPL(add_cpu);
1277 1277
1278/**
1279 * bringup_hibernate_cpu - Bring up the CPU that we hibernated on
1280 * @sleep_cpu: The cpu we hibernated on and should be brought up.
1281 *
1282 * On some architectures like arm64, we can hibernate on any CPU, but on
1283 * wake up the CPU we hibernated on might be offline as a side effect of
1284 * using maxcpus= for example.
1285 */
1286int bringup_hibernate_cpu(unsigned int sleep_cpu)
1287{
1288 int ret;
1289
1290 if (!cpu_online(sleep_cpu)) {
1291 pr_info("Hibernated on a CPU that is offline! Bringing CPU up.\n");
1292 ret = cpu_up(sleep_cpu);
1293 if (ret) {
1294 pr_err("Failed to bring hibernate-CPU up!\n");
1295 return ret;
1296 }
1297 }
1298 return 0;
1299}
1300
1278#ifdef CONFIG_PM_SLEEP_SMP1301#ifdef CONFIG_PM_SLEEP_SMP
1279static cpumask_var_t frozen_cpus;1302static cpumask_var_t frozen_cpus;
1280 1303

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