aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-28 19:14:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-28 19:14:17 -0400
commite4f2e5eaac8f5f903ca4a8cc944d26e68745d6bb (patch)
tree1a8d89561fa5b231202d5287acc2683eccadee7f /drivers/acpi
parent9a90e09854a3c7cc603ab8fc9163f77bb1f66cfa (diff)
parent2671717265ae6e720a9ba5f13fbec3a718983b65 (diff)
Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6
* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6: intel_idle: native hardware cpuidle driver for latest Intel processors ACPI: acpi_idle: touch TS_POLLING only in the non-MWAIT case acpi_pad: uses MONITOR/MWAIT, so it doesn't need to clear TS_POLLING sched: clarify commment for TS_POLLING ACPI: allow a native cpuidle driver to displace ACPI cpuidle: make cpuidle_curr_driver static cpuidle: add cpuidle_unregister_driver() error check cpuidle: fail to register if !CONFIG_CPU_IDLE
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_pad.c9
-rw-r--r--drivers/acpi/processor_driver.c15
-rw-r--r--drivers/acpi/processor_idle.c28
3 files changed, 26 insertions, 26 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index f169e516a1a..d269a8f3329 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -172,13 +172,6 @@ static int power_saving_thread(void *data)
172 172
173 do_sleep = 0; 173 do_sleep = 0;
174 174
175 current_thread_info()->status &= ~TS_POLLING;
176 /*
177 * TS_POLLING-cleared state must be visible before we test
178 * NEED_RESCHED:
179 */
180 smp_mb();
181
182 expire_time = jiffies + HZ * (100 - idle_pct) / 100; 175 expire_time = jiffies + HZ * (100 - idle_pct) / 100;
183 176
184 while (!need_resched()) { 177 while (!need_resched()) {
@@ -209,8 +202,6 @@ static int power_saving_thread(void *data)
209 } 202 }
210 } 203 }
211 204
212 current_thread_info()->status |= TS_POLLING;
213
214 /* 205 /*
215 * current sched_rt has threshold for rt task running time. 206 * current sched_rt has threshold for rt task running time.
216 * When a rt task uses 95% CPU time, the rt thread will be 207 * When a rt task uses 95% CPU time, the rt thread will be
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
index 5675d9747e8..b1034a9ada4 100644
--- a/drivers/acpi/processor_driver.c
+++ b/drivers/acpi/processor_driver.c
@@ -616,7 +616,8 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
616 acpi_processor_get_limit_info(pr); 616 acpi_processor_get_limit_info(pr);
617 617
618 618
619 acpi_processor_power_init(pr, device); 619 if (cpuidle_get_driver() == &acpi_idle_driver)
620 acpi_processor_power_init(pr, device);
620 621
621 pr->cdev = thermal_cooling_device_register("Processor", device, 622 pr->cdev = thermal_cooling_device_register("Processor", device,
622 &processor_cooling_ops); 623 &processor_cooling_ops);
@@ -920,9 +921,14 @@ static int __init acpi_processor_init(void)
920 if (!acpi_processor_dir) 921 if (!acpi_processor_dir)
921 return -ENOMEM; 922 return -ENOMEM;
922#endif 923#endif
923 result = cpuidle_register_driver(&acpi_idle_driver); 924
924 if (result < 0) 925 if (!cpuidle_register_driver(&acpi_idle_driver)) {
925 goto out_proc; 926 printk(KERN_DEBUG "ACPI: %s registered with cpuidle\n",
927 acpi_idle_driver.name);
928 } else {
929 printk(KERN_DEBUG "ACPI: acpi_idle yielding to %s",
930 cpuidle_get_driver()->name);
931 }
926 932
927 result = acpi_bus_register_driver(&acpi_processor_driver); 933 result = acpi_bus_register_driver(&acpi_processor_driver);
928 if (result < 0) 934 if (result < 0)
@@ -941,7 +947,6 @@ static int __init acpi_processor_init(void)
941out_cpuidle: 947out_cpuidle:
942 cpuidle_unregister_driver(&acpi_idle_driver); 948 cpuidle_unregister_driver(&acpi_idle_driver);
943 949
944out_proc:
945#ifdef CONFIG_ACPI_PROCFS 950#ifdef CONFIG_ACPI_PROCFS
946 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir); 951 remove_proc_entry(ACPI_PROCESSOR_CLASS, acpi_root_dir);
947#endif 952#endif
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 13c6cb703f1..2e8c27d48f2 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -872,6 +872,7 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
872 return(acpi_idle_enter_c1(dev, state)); 872 return(acpi_idle_enter_c1(dev, state));
873 873
874 local_irq_disable(); 874 local_irq_disable();
875
875 if (cx->entry_method != ACPI_CSTATE_FFH) { 876 if (cx->entry_method != ACPI_CSTATE_FFH) {
876 current_thread_info()->status &= ~TS_POLLING; 877 current_thread_info()->status &= ~TS_POLLING;
877 /* 878 /*
@@ -879,12 +880,12 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
879 * NEED_RESCHED: 880 * NEED_RESCHED:
880 */ 881 */
881 smp_mb(); 882 smp_mb();
882 }
883 883
884 if (unlikely(need_resched())) { 884 if (unlikely(need_resched())) {
885 current_thread_info()->status |= TS_POLLING; 885 current_thread_info()->status |= TS_POLLING;
886 local_irq_enable(); 886 local_irq_enable();
887 return 0; 887 return 0;
888 }
888 } 889 }
889 890
890 /* 891 /*
@@ -911,7 +912,8 @@ static int acpi_idle_enter_simple(struct cpuidle_device *dev,
911 sched_clock_idle_wakeup_event(idle_time_ns); 912 sched_clock_idle_wakeup_event(idle_time_ns);
912 913
913 local_irq_enable(); 914 local_irq_enable();
914 current_thread_info()->status |= TS_POLLING; 915 if (cx->entry_method != ACPI_CSTATE_FFH)
916 current_thread_info()->status |= TS_POLLING;
915 917
916 cx->usage++; 918 cx->usage++;
917 919
@@ -962,6 +964,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
962 } 964 }
963 965
964 local_irq_disable(); 966 local_irq_disable();
967
965 if (cx->entry_method != ACPI_CSTATE_FFH) { 968 if (cx->entry_method != ACPI_CSTATE_FFH) {
966 current_thread_info()->status &= ~TS_POLLING; 969 current_thread_info()->status &= ~TS_POLLING;
967 /* 970 /*
@@ -969,12 +972,12 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
969 * NEED_RESCHED: 972 * NEED_RESCHED:
970 */ 973 */
971 smp_mb(); 974 smp_mb();
972 }
973 975
974 if (unlikely(need_resched())) { 976 if (unlikely(need_resched())) {
975 current_thread_info()->status |= TS_POLLING; 977 current_thread_info()->status |= TS_POLLING;
976 local_irq_enable(); 978 local_irq_enable();
977 return 0; 979 return 0;
980 }
978 } 981 }
979 982
980 acpi_unlazy_tlb(smp_processor_id()); 983 acpi_unlazy_tlb(smp_processor_id());
@@ -1028,7 +1031,8 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
1028 sched_clock_idle_wakeup_event(idle_time_ns); 1031 sched_clock_idle_wakeup_event(idle_time_ns);
1029 1032
1030 local_irq_enable(); 1033 local_irq_enable();
1031 current_thread_info()->status |= TS_POLLING; 1034 if (cx->entry_method != ACPI_CSTATE_FFH)
1035 current_thread_info()->status |= TS_POLLING;
1032 1036
1033 cx->usage++; 1037 cx->usage++;
1034 1038