summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-27 01:29:24 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-27 01:29:24 +0200
commit551f5c74e17ba9257cdc35bf657ee448cad2d5b0 (patch)
treef4e4ca5f0624c75dbf285ada81bd564e51b8955e /drivers/acpi
parent8462d9df9d5033da4d25e59016b1e7a9d94a1f22 (diff)
parentb9d10be7a8e88fdcb12540387c219cdde87b0795 (diff)
Merge branch 'acpi-processor'
* acpi-processor: ACPI / processor: Acquire writer lock to update CPU maps ACPI / processor: Remove acpi_processor_get_limit_info()
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_processor.c21
-rw-r--r--drivers/acpi/processor_driver.c4
-rw-r--r--drivers/acpi/processor_thermal.c12
3 files changed, 19 insertions, 18 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 5a74a9c1e42c..f29e06efa479 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -178,14 +178,17 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT))
return -ENODEV;
+ cpu_maps_update_begin();
+ cpu_hotplug_begin();
+
ret = acpi_map_lsapic(pr->handle, &pr->id);
if (ret)
- return ret;
+ goto out;
ret = arch_register_cpu(pr->id);
if (ret) {
acpi_unmap_lsapic(pr->id);
- return ret;
+ goto out;
}
/*
@@ -195,7 +198,11 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
*/
pr_info("CPU%d has been hot-added\n", pr->id);
pr->flags.need_hotplug_init = 1;
- return 0;
+
+out:
+ cpu_hotplug_done();
+ cpu_maps_update_done();
+ return ret;
}
#else
static inline int acpi_processor_hotadd_init(struct acpi_processor *pr)
@@ -452,11 +459,15 @@ static void acpi_processor_remove(struct acpi_device *device)
per_cpu(processor_device_array, pr->id) = NULL;
per_cpu(processors, pr->id) = NULL;
+ cpu_maps_update_begin();
+ cpu_hotplug_begin();
+
/* Remove the CPU. */
- get_online_cpus();
arch_unregister_cpu(pr->id);
acpi_unmap_lsapic(pr->id);
- put_online_cpus();
+
+ cpu_hotplug_done();
+ cpu_maps_update_done();
try_offline_node(cpu_to_node(pr->id));
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index bd11ef93b0ce..e534ba66d5b8 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -175,7 +175,9 @@ static int __acpi_processor_start(struct acpi_device *device)
acpi_processor_load_module(pr);
#endif
acpi_processor_get_throttling_info(pr);
- acpi_processor_get_limit_info(pr);
+
+ if (pr->flags.throttling)
+ pr->flags.limit = 1;
if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver)
acpi_processor_power_init(pr);
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c
index e8e652710e65..d1d2e7fb5b30 100644
--- a/drivers/acpi/processor_thermal.c
+++ b/drivers/acpi/processor_thermal.c
@@ -186,18 +186,6 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
#endif
-int acpi_processor_get_limit_info(struct acpi_processor *pr)
-{
-
- if (!pr)
- return -EINVAL;
-
- if (pr->flags.throttling)
- pr->flags.limit = 1;
-
- return 0;
-}
-
/* thermal coolign device callbacks */
static int acpi_processor_max_state(struct acpi_processor *pr)
{