ARM: OMAP4: cpuidle: Fix the C-state reporting to cpuidle governor.

OMAP4 cpuidle driver is reporting the state requested by governor
rather than the actually attempted one.

This is obviously misleading sysfs and powertop cpuidle statistics.
Fix it so that stats are reported correctly.

Reported-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
[khilman@ti.com: minor changelog edits]
Signed-off-by: Kevin Hilman <khilman@ti.com>
This commit is contained in:
Santosh Shilimkar 2012-02-05 13:18:44 +05:30 коммит произвёл Kevin Hilman
Родитель 6369fd41fc
Коммит 03e4fd6eb2
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -65,7 +65,6 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
struct timespec ts_preidle, ts_postidle, ts_idle; struct timespec ts_preidle, ts_postidle, ts_idle;
u32 cpu1_state; u32 cpu1_state;
int idle_time; int idle_time;
int new_state_idx;
int cpu_id = smp_processor_id(); int cpu_id = smp_processor_id();
/* Used to keep track of the total time in idle */ /* Used to keep track of the total time in idle */
@ -84,8 +83,8 @@ static int omap4_enter_idle(struct cpuidle_device *dev,
*/ */
cpu1_state = pwrdm_read_pwrst(cpu1_pd); cpu1_state = pwrdm_read_pwrst(cpu1_pd);
if (cpu1_state != PWRDM_POWER_OFF) { if (cpu1_state != PWRDM_POWER_OFF) {
new_state_idx = drv->safe_state_index; index = drv->safe_state_index;
cx = cpuidle_get_statedata(&dev->states_usage[new_state_idx]); cx = cpuidle_get_statedata(&dev->states_usage[index]);
} }
if (index > 0) if (index > 0)