Skip to content

Commit 95ac706

Browse files
Sebastian Andrzej Siewiorrafaeljw
authored andcommitted
ACPI: processor: Replace deprecated CPU-hotplug functions
The functions cpu_hotplug_begin, cpu_hotplug_done, get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_write_lock(), cpus_write_unlock, cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent c500bee commit 95ac706

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/acpi/acpi_pad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)
249249

250250
static void acpi_pad_idle_cpus(unsigned int num_cpus)
251251
{
252-
get_online_cpus();
252+
cpus_read_lock();
253253

254254
num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());
255255
set_power_saving_task_num(num_cpus);
256256

257-
put_online_cpus();
257+
cpus_read_unlock();
258258
}
259259

260260
static uint32_t acpi_pad_idle_cpus_num(void)

drivers/acpi/acpi_processor.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
182182
return -ENODEV;
183183

184184
cpu_maps_update_begin();
185-
cpu_hotplug_begin();
185+
cpus_write_lock();
186186

187187
ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id);
188188
if (ret)
@@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
203203
pr->flags.need_hotplug_init = 1;
204204

205205
out:
206-
cpu_hotplug_done();
206+
cpus_write_unlock();
207207
cpu_maps_update_done();
208208
return ret;
209209
}
@@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)
454454
per_cpu(processors, pr->id) = NULL;
455455

456456
cpu_maps_update_begin();
457-
cpu_hotplug_begin();
457+
cpus_write_lock();
458458

459459
/* Remove the CPU. */
460460
arch_unregister_cpu(pr->id);
461461
acpi_unmap_cpu(pr->id);
462462

463-
cpu_hotplug_done();
463+
cpus_write_unlock();
464464
cpu_maps_update_done();
465465

466466
try_offline_node(cpu_to_node(pr->id));

drivers/acpi/processor_idle.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
13011301
if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) {
13021302

13031303
/* Protect against cpu-hotplug */
1304-
get_online_cpus();
1304+
cpus_read_lock();
13051305
cpuidle_pause_and_lock();
13061306

13071307
/* Disable all cpuidle devices */
@@ -1330,7 +1330,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
13301330
}
13311331
}
13321332
cpuidle_resume_and_unlock();
1333-
put_online_cpus();
1333+
cpus_read_unlock();
13341334
}
13351335

13361336
return 0;

0 commit comments

Comments
 (0)