diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:02:53 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-18 18:02:53 -0400 |
commit | 3db0bc97678d7de32f25514b290a0ca028dd4512 (patch) | |
tree | 45729aa3a8cecff0e4d4c1d27c2459109ae5a749 /drivers/acpi | |
parent | d9914cf66181b8aa0929775f5c6f675c6ebc3eb5 (diff) | |
parent | aa713cc3b22ccd24dc55df4e0770490781fe6a76 (diff) |
Merge branch 'pm-cpuidle'
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_driver.c | 7 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 39 |
2 files changed, 1 insertions, 45 deletions
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 0734086537b..8648b29f6ee 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -427,18 +427,11 @@ static int acpi_cpu_soft_notify(struct notifier_block *nfb, | |||
427 | * Initialize missing things | 427 | * Initialize missing things |
428 | */ | 428 | */ |
429 | if (pr->flags.need_hotplug_init) { | 429 | if (pr->flags.need_hotplug_init) { |
430 | struct cpuidle_driver *idle_driver = | ||
431 | cpuidle_get_driver(); | ||
432 | |||
433 | printk(KERN_INFO "Will online and init hotplugged " | 430 | printk(KERN_INFO "Will online and init hotplugged " |
434 | "CPU: %d\n", pr->id); | 431 | "CPU: %d\n", pr->id); |
435 | WARN(acpi_processor_start(pr), "Failed to start CPU:" | 432 | WARN(acpi_processor_start(pr), "Failed to start CPU:" |
436 | " %d\n", pr->id); | 433 | " %d\n", pr->id); |
437 | pr->flags.need_hotplug_init = 0; | 434 | pr->flags.need_hotplug_init = 0; |
438 | if (idle_driver && !strcmp(idle_driver->name, | ||
439 | "intel_idle")) { | ||
440 | intel_idle_cpu_init(pr->id); | ||
441 | } | ||
442 | /* Normal CPU soft online event */ | 435 | /* Normal CPU soft online event */ |
443 | } else { | 436 | } else { |
444 | acpi_processor_ppc_has_changed(pr, 0); | 437 | acpi_processor_ppc_has_changed(pr, 0); |
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 47a8caa89db..4cf964803d7 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -221,10 +221,6 @@ static void lapic_timer_state_broadcast(struct acpi_processor *pr, | |||
221 | 221 | ||
222 | #endif | 222 | #endif |
223 | 223 | ||
224 | /* | ||
225 | * Suspend / resume control | ||
226 | */ | ||
227 | static int acpi_idle_suspend; | ||
228 | static u32 saved_bm_rld; | 224 | static u32 saved_bm_rld; |
229 | 225 | ||
230 | static void acpi_idle_bm_rld_save(void) | 226 | static void acpi_idle_bm_rld_save(void) |
@@ -243,21 +239,13 @@ static void acpi_idle_bm_rld_restore(void) | |||
243 | 239 | ||
244 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) | 240 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state) |
245 | { | 241 | { |
246 | if (acpi_idle_suspend == 1) | ||
247 | return 0; | ||
248 | |||
249 | acpi_idle_bm_rld_save(); | 242 | acpi_idle_bm_rld_save(); |
250 | acpi_idle_suspend = 1; | ||
251 | return 0; | 243 | return 0; |
252 | } | 244 | } |
253 | 245 | ||
254 | int acpi_processor_resume(struct acpi_device * device) | 246 | int acpi_processor_resume(struct acpi_device * device) |
255 | { | 247 | { |
256 | if (acpi_idle_suspend == 0) | ||
257 | return 0; | ||
258 | |||
259 | acpi_idle_bm_rld_restore(); | 248 | acpi_idle_bm_rld_restore(); |
260 | acpi_idle_suspend = 0; | ||
261 | return 0; | 249 | return 0; |
262 | } | 250 | } |
263 | 251 | ||
@@ -595,7 +583,6 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, | |||
595 | */ | 583 | */ |
596 | cx->valid = 1; | 584 | cx->valid = 1; |
597 | 585 | ||
598 | cx->latency_ticks = cx->latency; | ||
599 | /* | 586 | /* |
600 | * On older chipsets, BM_RLD needs to be set | 587 | * On older chipsets, BM_RLD needs to be set |
601 | * in order for Bus Master activity to wake the | 588 | * in order for Bus Master activity to wake the |
@@ -628,7 +615,6 @@ static int acpi_processor_power_verify(struct acpi_processor *pr) | |||
628 | if (!cx->address) | 615 | if (!cx->address) |
629 | break; | 616 | break; |
630 | cx->valid = 1; | 617 | cx->valid = 1; |
631 | cx->latency_ticks = cx->latency; /* Normalize latency */ | ||
632 | break; | 618 | break; |
633 | 619 | ||
634 | case ACPI_STATE_C3: | 620 | case ACPI_STATE_C3: |
@@ -763,11 +749,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
763 | 749 | ||
764 | local_irq_disable(); | 750 | local_irq_disable(); |
765 | 751 | ||
766 | if (acpi_idle_suspend) { | ||
767 | local_irq_enable(); | ||
768 | cpu_relax(); | ||
769 | return -EBUSY; | ||
770 | } | ||
771 | 752 | ||
772 | lapic_timer_state_broadcast(pr, cx, 1); | 753 | lapic_timer_state_broadcast(pr, cx, 1); |
773 | kt1 = ktime_get_real(); | 754 | kt1 = ktime_get_real(); |
@@ -779,7 +760,6 @@ static int acpi_idle_enter_c1(struct cpuidle_device *dev, | |||
779 | dev->last_residency = (int)idle_time; | 760 | dev->last_residency = (int)idle_time; |
780 | 761 | ||
781 | local_irq_enable(); | 762 | local_irq_enable(); |
782 | cx->usage++; | ||
783 | lapic_timer_state_broadcast(pr, cx, 0); | 763 | lapic_timer_state_broadcast(pr, cx, 0); |
784 | 764 | ||
785 | return index; | 765 | return index; |
@@ -838,11 +818,6 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
838 | 818 | ||
839 | local_irq_disable(); | 819 | local_irq_disable(); |
840 | 820 | ||
841 | if (acpi_idle_suspend) { | ||
842 | local_irq_enable(); | ||
843 | cpu_relax(); | ||
844 | return -EBUSY; | ||
845 | } | ||
846 | 821 | ||
847 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 822 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
848 | current_thread_info()->status &= ~TS_POLLING; | 823 | current_thread_info()->status &= ~TS_POLLING; |
@@ -887,10 +862,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev, | |||
887 | if (cx->entry_method != ACPI_CSTATE_FFH) | 862 | if (cx->entry_method != ACPI_CSTATE_FFH) |
888 | current_thread_info()->status |= TS_POLLING; | 863 | current_thread_info()->status |= TS_POLLING; |
889 | 864 | ||
890 | cx->usage++; | ||
891 | |||
892 | lapic_timer_state_broadcast(pr, cx, 0); | 865 | lapic_timer_state_broadcast(pr, cx, 0); |
893 | cx->time += idle_time; | ||
894 | return index; | 866 | return index; |
895 | } | 867 | } |
896 | 868 | ||
@@ -928,8 +900,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
928 | drv, drv->safe_state_index); | 900 | drv, drv->safe_state_index); |
929 | } else { | 901 | } else { |
930 | local_irq_disable(); | 902 | local_irq_disable(); |
931 | if (!acpi_idle_suspend) | 903 | acpi_safe_halt(); |
932 | acpi_safe_halt(); | ||
933 | local_irq_enable(); | 904 | local_irq_enable(); |
934 | return -EBUSY; | 905 | return -EBUSY; |
935 | } | 906 | } |
@@ -937,11 +908,6 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
937 | 908 | ||
938 | local_irq_disable(); | 909 | local_irq_disable(); |
939 | 910 | ||
940 | if (acpi_idle_suspend) { | ||
941 | local_irq_enable(); | ||
942 | cpu_relax(); | ||
943 | return -EBUSY; | ||
944 | } | ||
945 | 911 | ||
946 | if (cx->entry_method != ACPI_CSTATE_FFH) { | 912 | if (cx->entry_method != ACPI_CSTATE_FFH) { |
947 | current_thread_info()->status &= ~TS_POLLING; | 913 | current_thread_info()->status &= ~TS_POLLING; |
@@ -1014,10 +980,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev, | |||
1014 | if (cx->entry_method != ACPI_CSTATE_FFH) | 980 | if (cx->entry_method != ACPI_CSTATE_FFH) |
1015 | current_thread_info()->status |= TS_POLLING; | 981 | current_thread_info()->status |= TS_POLLING; |
1016 | 982 | ||
1017 | cx->usage++; | ||
1018 | |||
1019 | lapic_timer_state_broadcast(pr, cx, 0); | 983 | lapic_timer_state_broadcast(pr, cx, 0); |
1020 | cx->time += idle_time; | ||
1021 | return index; | 984 | return index; |
1022 | } | 985 | } |
1023 | 986 | ||