diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/acpi/processor_driver.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/acpi/processor_driver.c')
-rw-r--r-- | drivers/acpi/processor_driver.c | 68 |
1 files changed, 8 insertions, 60 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 347eb21b2353..a4e0f1ba6040 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -40,8 +40,6 @@ | |||
40 | #include <linux/pm.h> | 40 | #include <linux/pm.h> |
41 | #include <linux/cpufreq.h> | 41 | #include <linux/cpufreq.h> |
42 | #include <linux/cpu.h> | 42 | #include <linux/cpu.h> |
43 | #include <linux/proc_fs.h> | ||
44 | #include <linux/seq_file.h> | ||
45 | #include <linux/dmi.h> | 43 | #include <linux/dmi.h> |
46 | #include <linux/moduleparam.h> | 44 | #include <linux/moduleparam.h> |
47 | #include <linux/cpuidle.h> | 45 | #include <linux/cpuidle.h> |
@@ -244,43 +242,6 @@ static int acpi_processor_errata(struct acpi_processor *pr) | |||
244 | return result; | 242 | return result; |
245 | } | 243 | } |
246 | 244 | ||
247 | static struct proc_dir_entry *acpi_processor_dir = NULL; | ||
248 | |||
249 | static int __cpuinit acpi_processor_add_fs(struct acpi_device *device) | ||
250 | { | ||
251 | struct proc_dir_entry *entry = NULL; | ||
252 | |||
253 | |||
254 | if (!acpi_device_dir(device)) { | ||
255 | acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), | ||
256 | acpi_processor_dir); | ||
257 | if (!acpi_device_dir(device)) | ||
258 | return -ENODEV; | ||
259 | } | ||
260 | |||
261 | /* 'throttling' [R/W] */ | ||
262 | entry = proc_create_data(ACPI_PROCESSOR_FILE_THROTTLING, | ||
263 | S_IFREG | S_IRUGO | S_IWUSR, | ||
264 | acpi_device_dir(device), | ||
265 | &acpi_processor_throttling_fops, | ||
266 | acpi_driver_data(device)); | ||
267 | if (!entry) | ||
268 | return -EIO; | ||
269 | return 0; | ||
270 | } | ||
271 | static int acpi_processor_remove_fs(struct acpi_device *device) | ||
272 | { | ||
273 | |||
274 | if (acpi_device_dir(device)) { | ||
275 | remove_proc_entry(ACPI_PROCESSOR_FILE_THROTTLING, | ||
276 | acpi_device_dir(device)); | ||
277 | remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); | ||
278 | acpi_device_dir(device) = NULL; | ||
279 | } | ||
280 | |||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | /* -------------------------------------------------------------------------- | 245 | /* -------------------------------------------------------------------------- |
285 | Driver Interface | 246 | Driver Interface |
286 | -------------------------------------------------------------------------- */ | 247 | -------------------------------------------------------------------------- */ |
@@ -466,8 +427,13 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, | |||
466 | if (action == CPU_ONLINE && pr) { | 427 | if (action == CPU_ONLINE && pr) { |
467 | acpi_processor_ppc_has_changed(pr, 0); | 428 | acpi_processor_ppc_has_changed(pr, 0); |
468 | acpi_processor_cst_has_changed(pr); | 429 | acpi_processor_cst_has_changed(pr); |
430 | acpi_processor_reevaluate_tstate(pr, action); | ||
469 | acpi_processor_tstate_has_changed(pr); | 431 | acpi_processor_tstate_has_changed(pr); |
470 | } | 432 | } |
433 | if (action == CPU_DEAD && pr) { | ||
434 | /* invalidate the flag.throttling after one CPU is offline */ | ||
435 | acpi_processor_reevaluate_tstate(pr, action); | ||
436 | } | ||
471 | return NOTIFY_OK; | 437 | return NOTIFY_OK; |
472 | } | 438 | } |
473 | 439 | ||
@@ -525,14 +491,10 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
525 | 491 | ||
526 | per_cpu(processors, pr->id) = pr; | 492 | per_cpu(processors, pr->id) = pr; |
527 | 493 | ||
528 | result = acpi_processor_add_fs(device); | ||
529 | if (result) | ||
530 | goto err_free_cpumask; | ||
531 | |||
532 | sysdev = get_cpu_sysdev(pr->id); | 494 | sysdev = get_cpu_sysdev(pr->id); |
533 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { | 495 | if (sysfs_create_link(&device->dev.kobj, &sysdev->kobj, "sysdev")) { |
534 | result = -EFAULT; | 496 | result = -EFAULT; |
535 | goto err_remove_fs; | 497 | goto err_free_cpumask; |
536 | } | 498 | } |
537 | 499 | ||
538 | #ifdef CONFIG_CPU_FREQ | 500 | #ifdef CONFIG_CPU_FREQ |
@@ -578,8 +540,6 @@ err_thermal_unregister: | |||
578 | thermal_cooling_device_unregister(pr->cdev); | 540 | thermal_cooling_device_unregister(pr->cdev); |
579 | err_power_exit: | 541 | err_power_exit: |
580 | acpi_processor_power_exit(pr, device); | 542 | acpi_processor_power_exit(pr, device); |
581 | err_remove_fs: | ||
582 | acpi_processor_remove_fs(device); | ||
583 | err_free_cpumask: | 543 | err_free_cpumask: |
584 | free_cpumask_var(pr->throttling.shared_cpu_map); | 544 | free_cpumask_var(pr->throttling.shared_cpu_map); |
585 | 545 | ||
@@ -608,8 +568,6 @@ static int acpi_processor_remove(struct acpi_device *device, int type) | |||
608 | 568 | ||
609 | sysfs_remove_link(&device->dev.kobj, "sysdev"); | 569 | sysfs_remove_link(&device->dev.kobj, "sysdev"); |
610 | 570 | ||
611 | acpi_processor_remove_fs(device); | ||
612 | |||
613 | if (pr->cdev) { | 571 | if (pr->cdev) { |
614 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); | 572 | sysfs_remove_link(&device->dev.kobj, "thermal_cooling"); |
615 | sysfs_remove_link(&pr->cdev->device.kobj, "device"); | 573 | sysfs_remove_link(&pr->cdev->device.kobj, "device"); |
@@ -677,8 +635,8 @@ int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) | |||
677 | return 0; | 635 | return 0; |
678 | } | 636 | } |
679 | 637 | ||
680 | static void __ref acpi_processor_hotplug_notify(acpi_handle handle, | 638 | static void acpi_processor_hotplug_notify(acpi_handle handle, |
681 | u32 event, void *data) | 639 | u32 event, void *data) |
682 | { | 640 | { |
683 | struct acpi_processor *pr; | 641 | struct acpi_processor *pr; |
684 | struct acpi_device *device = NULL; | 642 | struct acpi_device *device = NULL; |
@@ -842,10 +800,6 @@ static int __init acpi_processor_init(void) | |||
842 | 800 | ||
843 | memset(&errata, 0, sizeof(errata)); | 801 | memset(&errata, 0, sizeof(errata)); |
844 | 802 | ||
845 | acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); | ||
846 | if (!acpi_processor_dir) | ||
847 | return -ENOMEM; | ||
848 | |||
849 | if (!cpuidle_register_driver(&acpi_idle_driver)) { | 803 | if (!cpuidle_register_driver(&acpi_idle_driver)) { |
850 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", | 804 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", |
851 | acpi_idle_driver.name); | 805 | acpi_idle_driver.name); |
@@ -871,8 +825,6 @@ static int __init acpi_processor_init(void) | |||
871 | out_cpuidle: | 825 | out_cpuidle: |
872 | cpuidle_unregister_driver(&acpi_idle_driver); | 826 | cpuidle_unregister_driver(&acpi_idle_driver); |
873 | 827 | ||
874 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | ||
875 | |||
876 | return result; | 828 | return result; |
877 | } | 829 | } |
878 | 830 | ||
@@ -891,14 +843,10 @@ static void __exit acpi_processor_exit(void) | |||
891 | 843 | ||
892 | cpuidle_unregister_driver(&acpi_idle_driver); | 844 | cpuidle_unregister_driver(&acpi_idle_driver); |
893 | 845 | ||
894 | remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); | ||
895 | |||
896 | return; | 846 | return; |
897 | } | 847 | } |
898 | 848 | ||
899 | module_init(acpi_processor_init); | 849 | module_init(acpi_processor_init); |
900 | module_exit(acpi_processor_exit); | 850 | module_exit(acpi_processor_exit); |
901 | 851 | ||
902 | EXPORT_SYMBOL(acpi_processor_set_thermal_limit); | ||
903 | |||
904 | MODULE_ALIAS("processor"); | 852 | MODULE_ALIAS("processor"); |