aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorZhao Yakui <yakui.zhao@intel.com>2010-06-01 23:04:09 -0400
committerLen Brown <len.brown@intel.com>2010-06-04 15:22:18 -0400
commit157317ba3ec3e5a4d9683b8d24ba40b4f8f3296b (patch)
tree60cc7c2c5138837d25221e22cbd6ba966822b01f /drivers/acpi
parent67a3e12b05e055c0415c556a315a3d3eb637e29e (diff)
ACPI: Fix the incorrect calculation about C-state idle time
The C-state idle time is not calculated correctly, which will return the wrong residency time in C-state. It will have the following effects: 1. The system can't choose the deeper C-state when it is idle next time. Of course the system power is increased. E.g. On one server machine about 40W idle power is increased. 2. The powertop shows that it will stay in C0 running state about 95% time although the system is idle at most time. 2.6.35-rc1 regression caused-by: 2da513f582a96c053aacc2c92873978d2ea7abff (ACPI: Minor cleanup eliminating redundant PMTIMER_TICKS to NS conversion) Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Reported-by: Yu Zhidong <zhidong.yu@intel.com> Tested-by: Yu Zhidong <zhidong.yu@intel.com> Acked-by: Venkatesh Pallipadi <venki@google.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/processor_idle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 2e8c27d48f2b..6b38a6b43ce8 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1022,7 +1022,7 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
1022 spin_unlock(&c3_lock); 1022 spin_unlock(&c3_lock);
1023 } 1023 }
1024 kt2 = ktime_get_real(); 1024 kt2 = ktime_get_real();
1025 idle_time_ns = ktime_to_us(ktime_sub(kt2, kt1)); 1025 idle_time_ns = ktime_to_ns(ktime_sub(kt2, kt1));
1026 idle_time = idle_time_ns; 1026 idle_time = idle_time_ns;
1027 do_div(idle_time, NSEC_PER_USEC); 1027 do_div(idle_time, NSEC_PER_USEC);
1028 1028