diff options
author | Deepthi Dharwar <deepthi@linux.vnet.ibm.com> | 2011-10-28 06:50:42 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-11-06 21:13:58 -0500 |
commit | 46bcfad7a819bd17ac4e831b04405152d59784ab (patch) | |
tree | 20041e788154d103edff2699f88d4a30320e3ee2 /drivers/acpi/processor_driver.c | |
parent | 4202735e8ab6ecfb0381631a0d0b58fefe0bd4e2 (diff) |
cpuidle: Single/Global registration of idle states
This patch makes the cpuidle_states structure global (single copy)
instead of per-cpu. The statistics needed on per-cpu basis
by the governor are kept per-cpu. This simplifies the cpuidle
subsystem as state registration is done by single cpu only.
Having single copy of cpuidle_states saves memory. Rare case
of asymmetric C-states can be handled within the cpuidle driver
and architectures such as POWER do not have asymmetric C-states.
Having single/global registration of all the idle states,
dynamic C-state transitions on x86 are handled by
the boot cpu. Here, the boot cpu would disable all the devices,
re-populate the states and later enable all the devices,
irrespective of the cpu that would receive the notification first.
Reference:
https://lkml.org/lkml/2011/4/25/83
Signed-off-by: Deepthi Dharwar <deepthi@linux.vnet.ibm.com>
Signed-off-by: Trinabh Gupta <g.trinabh@gmail.com>
Tested-by: Jean Pihet <j-pihet@ti.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_driver.c')
-rw-r--r-- | drivers/acpi/processor_driver.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index a4e0f1ba6040..9d7bc9f6b6cc 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -426,7 +426,7 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, | |||
426 | 426 | ||
427 | if (action == CPU_ONLINE && pr) { | 427 | if (action == CPU_ONLINE && pr) { |
428 | acpi_processor_ppc_has_changed(pr, 0); | 428 | acpi_processor_ppc_has_changed(pr, 0); |
429 | acpi_processor_cst_has_changed(pr); | 429 | acpi_processor_hotplug(pr); |
430 | acpi_processor_reevaluate_tstate(pr, action); | 430 | acpi_processor_reevaluate_tstate(pr, action); |
431 | acpi_processor_tstate_has_changed(pr); | 431 | acpi_processor_tstate_has_changed(pr); |
432 | } | 432 | } |
@@ -503,8 +503,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device) | |||
503 | acpi_processor_get_throttling_info(pr); | 503 | acpi_processor_get_throttling_info(pr); |
504 | acpi_processor_get_limit_info(pr); | 504 | acpi_processor_get_limit_info(pr); |
505 | 505 | ||
506 | 506 | if (!cpuidle_get_driver() || cpuidle_get_driver() == &acpi_idle_driver) | |
507 | if (cpuidle_get_driver() == &acpi_idle_driver) | ||
508 | acpi_processor_power_init(pr, device); | 507 | acpi_processor_power_init(pr, device); |
509 | 508 | ||
510 | pr->cdev = thermal_cooling_device_register("Processor", device, | 509 | pr->cdev = thermal_cooling_device_register("Processor", device, |
@@ -800,17 +799,9 @@ static int __init acpi_processor_init(void) | |||
800 | 799 | ||
801 | memset(&errata, 0, sizeof(errata)); | 800 | memset(&errata, 0, sizeof(errata)); |
802 | 801 | ||
803 | if (!cpuidle_register_driver(&acpi_idle_driver)) { | ||
804 | printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n", | ||
805 | acpi_idle_driver.name); | ||
806 | } else { | ||
807 | printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s\n", | ||
808 | cpuidle_get_driver()->name); | ||
809 | } | ||
810 | |||
811 | result = acpi_bus_register_driver(&acpi_processor_driver); | 802 | result = acpi_bus_register_driver(&acpi_processor_driver); |
812 | if (result < 0) | 803 | if (result < 0) |
813 | goto out_cpuidle; | 804 | return result; |
814 | 805 | ||
815 | acpi_processor_install_hotplug_notify(); | 806 | acpi_processor_install_hotplug_notify(); |
816 | 807 | ||
@@ -821,11 +812,6 @@ static int __init acpi_processor_init(void) | |||
821 | acpi_processor_throttling_init(); | 812 | acpi_processor_throttling_init(); |
822 | 813 | ||
823 | return 0; | 814 | return 0; |
824 | |||
825 | out_cpuidle: | ||
826 | cpuidle_unregister_driver(&acpi_idle_driver); | ||
827 | |||
828 | return result; | ||
829 | } | 815 | } |
830 | 816 | ||
831 | static void __exit acpi_processor_exit(void) | 817 | static void __exit acpi_processor_exit(void) |