When a cpuidle driver is called it can choose to enter a different state
that what was asked from above. When this happens it should return the
actual entered_state index for proper accounting.
This fixes the various imx cpuidle drivers which depend on low busfreq
for LOW-POWER-IDLE to correctly report that they entered WAIT instead.
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
imx6_set_lpm(WAIT_UNCLOCKED);
if ((index == 1) || ((mode != BUS_FREQ_LOW) && index == 2)) {
+ index = 1;
cpu_do_idle();
} else {
imx_gpc_switch_pupscr_clk(true);
imx6_set_lpm(WAIT_UNCLOCKED);
if ((index == 1) || ((mode != BUS_FREQ_LOW) && index == 2)) {
+ index = 1;
cpu_do_idle();
} else {
/* Need to notify there is a cpu pm operation. */
imx6_set_lpm(WAIT_UNCLOCKED);
if ((index == 1) || ((mode != BUS_FREQ_LOW) && index == 2)) {
cpu_do_idle();
+ index = 1;
} else {
/*
* i.MX6UL TO1.0 ARM power up uses IPG/2048 as clock source,
int mode = get_bus_freq_mode();
if ((index == 1) || ((mode != BUS_FREQ_LOW) && index == 2)) {
+ index = 1;
if (atomic_inc_return(&master_wait) == num_online_cpus())
imx_gpcv2_set_lpm_mode(WAIT_UNCLOCKED);