diff options
Diffstat (limited to 'drivers/idle/intel_idle.c')
-rw-r--r-- | drivers/idle/intel_idle.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index a46dddf61078..a1c888d2216a 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
@@ -81,7 +81,7 @@ static unsigned int mwait_substates; | |||
81 | static unsigned int lapic_timer_reliable_states = (1 << 1); /* Default to only C1 */ | 81 | static unsigned int lapic_timer_reliable_states = (1 << 1); /* Default to only C1 */ |
82 | 82 | ||
83 | static struct cpuidle_device __percpu *intel_idle_cpuidle_devices; | 83 | static struct cpuidle_device __percpu *intel_idle_cpuidle_devices; |
84 | static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state); | 84 | static int intel_idle(struct cpuidle_device *dev, int index); |
85 | 85 | ||
86 | static struct cpuidle_state *cpuidle_state_table; | 86 | static struct cpuidle_state *cpuidle_state_table; |
87 | 87 | ||
@@ -209,12 +209,13 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = { | |||
209 | /** | 209 | /** |
210 | * intel_idle | 210 | * intel_idle |
211 | * @dev: cpuidle_device | 211 | * @dev: cpuidle_device |
212 | * @state: cpuidle state | 212 | * @index: index of cpuidle state |
213 | * | 213 | * |
214 | */ | 214 | */ |
215 | static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) | 215 | static int intel_idle(struct cpuidle_device *dev, int index) |
216 | { | 216 | { |
217 | unsigned long ecx = 1; /* break on interrupt flag */ | 217 | unsigned long ecx = 1; /* break on interrupt flag */ |
218 | struct cpuidle_state *state = &dev->states[index]; | ||
218 | unsigned long eax = (unsigned long)cpuidle_get_statedata(state); | 219 | unsigned long eax = (unsigned long)cpuidle_get_statedata(state); |
219 | unsigned int cstate; | 220 | unsigned int cstate; |
220 | ktime_t kt_before, kt_after; | 221 | ktime_t kt_before, kt_after; |
@@ -256,7 +257,10 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state) | |||
256 | if (!(lapic_timer_reliable_states & (1 << (cstate)))) | 257 | if (!(lapic_timer_reliable_states & (1 << (cstate)))) |
257 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu); | 258 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu); |
258 | 259 | ||
259 | return usec_delta; | 260 | /* Update cpuidle counters */ |
261 | dev->last_residency = (int)usec_delta; | ||
262 | |||
263 | return index; | ||
260 | } | 264 | } |
261 | 265 | ||
262 | static void __setup_broadcast_timer(void *arg) | 266 | static void __setup_broadcast_timer(void *arg) |