diff options
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 5ce07b517c58..8504a2108557 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/cpu.h> | 16 | #include <linux/cpu.h> |
17 | #include <linux/cpuidle.h> | 17 | #include <linux/cpuidle.h> |
18 | #include <linux/ktime.h> | 18 | #include <linux/ktime.h> |
19 | #include <linux/hrtimer.h> | ||
19 | 20 | ||
20 | #include "cpuidle.h" | 21 | #include "cpuidle.h" |
21 | 22 | ||
@@ -56,10 +57,22 @@ static void cpuidle_idle_call(void) | |||
56 | if (pm_idle_old) | 57 | if (pm_idle_old) |
57 | pm_idle_old(); | 58 | pm_idle_old(); |
58 | else | 59 | else |
60 | #if defined(CONFIG_ARCH_HAS_DEFAULT_IDLE) | ||
61 | default_idle(); | ||
62 | #else | ||
59 | local_irq_enable(); | 63 | local_irq_enable(); |
64 | #endif | ||
60 | return; | 65 | return; |
61 | } | 66 | } |
62 | 67 | ||
68 | #if 0 | ||
69 | /* shows regressions, re-enable for 2.6.29 */ | ||
70 | /* | ||
71 | * run any timers that can be run now, at this point | ||
72 | * before calculating the idle duration etc. | ||
73 | */ | ||
74 | hrtimer_peek_ahead_timers(); | ||
75 | #endif | ||
63 | /* ask the governor for the next state */ | 76 | /* ask the governor for the next state */ |
64 | next_state = cpuidle_curr_governor->select(dev); | 77 | next_state = cpuidle_curr_governor->select(dev); |
65 | if (need_resched()) | 78 | if (need_resched()) |
@@ -67,8 +80,11 @@ static void cpuidle_idle_call(void) | |||
67 | target_state = &dev->states[next_state]; | 80 | target_state = &dev->states[next_state]; |
68 | 81 | ||
69 | /* enter the state and update stats */ | 82 | /* enter the state and update stats */ |
70 | dev->last_residency = target_state->enter(dev, target_state); | ||
71 | dev->last_state = target_state; | 83 | dev->last_state = target_state; |
84 | dev->last_residency = target_state->enter(dev, target_state); | ||
85 | if (dev->last_state) | ||
86 | target_state = dev->last_state; | ||
87 | |||
72 | target_state->time += (unsigned long long)dev->last_residency; | 88 | target_state->time += (unsigned long long)dev->last_residency; |
73 | target_state->usage++; | 89 | target_state->usage++; |
74 | 90 | ||