diff options
author | Leonard Crestez <leonard.crestez@nxp.com> | 2017-03-13 12:35:24 +0200 |
---|---|---|
committer | Jason Liu <jason.hui.liu@nxp.com> | 2019-02-12 10:25:57 +0800 |
commit | 3c1eb5c34386bc51929d9fcdcfddca3a234dc04d (patch) | |
tree | c0f71f163c6f287e66147fa846d6e4d85f67ba9f /arch/arm/mach-imx | |
parent | 1cb0ce586f2f4b1fbb32df47839f905db2904391 (diff) |
ARM: cpuidle-imx*: Report the entered state index
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>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6sll.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6sx.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx6ul.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-imx/cpuidle-imx7d.c | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/cpuidle-imx6sll.c b/arch/arm/mach-imx/cpuidle-imx6sll.c index 8e06f339ecf4..65d82e5855e2 100644 --- a/arch/arm/mach-imx/cpuidle-imx6sll.c +++ b/arch/arm/mach-imx/cpuidle-imx6sll.c @@ -97,6 +97,7 @@ static int imx6sll_enter_wait(struct cpuidle_device *dev, 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); diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c index c1c7ad428771..be73709ebce5 100644 --- a/arch/arm/mach-imx/cpuidle-imx6sx.c +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c @@ -109,6 +109,7 @@ static int imx6sx_enter_wait(struct cpuidle_device *dev, 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. */ diff --git a/arch/arm/mach-imx/cpuidle-imx6ul.c b/arch/arm/mach-imx/cpuidle-imx6ul.c index 8e0fdf7185db..7708d878615c 100644 --- a/arch/arm/mach-imx/cpuidle-imx6ul.c +++ b/arch/arm/mach-imx/cpuidle-imx6ul.c @@ -98,6 +98,7 @@ static int imx6ul_enter_wait(struct cpuidle_device *dev, 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, diff --git a/arch/arm/mach-imx/cpuidle-imx7d.c b/arch/arm/mach-imx/cpuidle-imx7d.c index 4ba99d87db2b..83d1f48ed0d5 100644 --- a/arch/arm/mach-imx/cpuidle-imx7d.c +++ b/arch/arm/mach-imx/cpuidle-imx7d.c @@ -94,6 +94,7 @@ static int imx7d_enter_low_power_idle(struct cpuidle_device *dev, 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); |