MLK-16750-6 arm: imx7d: cpuidle: Fix missing decrement of master_lpi
authorPeng Fan <peng.fan@nxp.com>
Thu, 27 Jul 2017 01:15:31 +0000 (09:15 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:55:40 +0000 (15:55 -0500)
This fixes commit ("MLK15034: ARM: cpuidle imx7d: Check
IPIs manually before LPI").

In this patch, also need to take care of psci part.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
arch/arm/mach-imx/cpuidle-imx7d.c

index 9b0fd7d..6e12ebd 100644 (file)
@@ -172,6 +172,7 @@ static int imx7d_enter_low_power_idle(struct cpuidle_device *dev,
                        spin_lock(&psci_lock);
                        if (atomic_inc_return(&master_lpi) == num_online_cpus()) {
                                if (imx7d_gic_sgis_pending()) {
+                                       atomic_dec(&master_lpi);
                                        index = -1;
                                        goto psci_skip_lpi_flow;
                                }
@@ -209,6 +210,7 @@ psci_skip_lpi_flow:
                                 * any additional IPIs.
                                 */
                                if (imx7d_gic_sgis_pending()) {
+                                       atomic_dec(&master_lpi);
                                        index = -1;
                                        goto skip_lpi_flow;
                                }