aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
-rw-r--r--drivers/cpuidle/cpuidle.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 5ce07b517c58..bb6e3b338043 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -56,7 +56,11 @@ static void cpuidle_idle_call(void)
56 if (pm_idle_old) 56 if (pm_idle_old)
57 pm_idle_old(); 57 pm_idle_old();
58 else 58 else
59#if defined(CONFIG_ARCH_HAS_DEFAULT_IDLE)
60 default_idle();
61#else
59 local_irq_enable(); 62 local_irq_enable();
63#endif
60 return; 64 return;
61 } 65 }
62 66
@@ -67,8 +71,11 @@ static void cpuidle_idle_call(void)
67 target_state = &dev->states[next_state]; 71 target_state = &dev->states[next_state];
68 72
69 /* enter the state and update stats */ 73 /* enter the state and update stats */
70 dev->last_residency = target_state->enter(dev, target_state);
71 dev->last_state = target_state; 74 dev->last_state = target_state;
75 dev->last_residency = target_state->enter(dev, target_state);
76 if (dev->last_state)
77 target_state = dev->last_state;
78
72 target_state->time += (unsigned long long)dev->last_residency; 79 target_state->time += (unsigned long long)dev->last_residency;
73 target_state->usage++; 80 target_state->usage++;
74 81