cpuidle: tegra: Fix C7 idling state on Tegra114
Subsystems (2)
PATCH 1/2 cpuidle: tegra: Fix C7 idling state on Tegra114
Trusted Foundation firmware doesn't implement the do_idle call and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set the NOFLUSH_L2 mode via firmware call, which is a NO-OP on Tegra30/124, and then proceed to the C7 idling, like it was done by the older Tegra114 cpuidle driver.
Fixes 14e086baca50 ("cpuidle: tegra: Squash Tegra114 driver into the common driver")
Cc [email protected] # 5.7+
Reported-by Anton Bambura <[email protected]>
Tested-by Anton Bambura <[email protected]>
Tested-by Matt Merhar <[email protected]>
Tested-by Peter Geis <[email protected]>
Signed-off-by Dmitry Osipenko <[email protected]>
--- drivers/cpuidle/cpuidle-tegra.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/cpuidle/cpuidle-tegra.c +6 -6
@@ -135,13 +135,13 @@ static int tegra_cpuidle_c7_enter(void) {int err; -if (tegra_cpuidle_using_firmware ()) { - err =call_firmware_op (prepare_idle,TF_PM_MODE_LP2_NOFLUSH_L2 ); -if (err) -return err; + err =call_firmware_op (prepare_idle,TF_PM_MODE_LP2_NOFLUSH_L2 ); +if (err && err != -ENOSYS ) +return err; -return call_firmware_op (do_idle,0 ); - } + err =call_firmware_op (do_idle,0 ); +if (err != -ENOSYS ) +return err;return cpu_suspend (0 , tegra30_pm_secondary_cpu_suspend); }
Signature · 1 line
2.29.2
PATCH 2/2 cpuidle: tegra: Remove do_idle firmware call
The do_idle firmware call is unused by all Tegra SoCs, hence remove it in order to keep driver's code clean.
Tested-by Anton Bambura <[email protected]>
Tested-by Matt Merhar <[email protected]>
Tested-by Peter Geis <[email protected]>
Signed-off-by Dmitry Osipenko <[email protected]>
--- drivers/cpuidle/cpuidle-tegra.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/cpuidle/cpuidle-tegra.c +1 -12
@@ -48,11 +48,6 @@ enum tegra_state {static atomic_t tegra_idle_barrier;static atomic_t tegra_abort_flag; -static inline bool tegra_cpuidle_using_firmware (void ) -{ -return firmware_ops->prepare_idle && firmware_ops->do_idle; -} -static void tegra_cpuidle_report_cpus_state (void ) {unsigned long cpu, lcpu, csr;
@@ -139,10 +134,6 @@ static int tegra_cpuidle_c7_enter(void)if (err && err != -ENOSYS )return err; - err =call_firmware_op (do_idle,0 ); -if (err != -ENOSYS ) -return err; -return cpu_suspend (0 , tegra30_pm_secondary_cpu_suspend); }
@@ -356,9 +347,7 @@ static int tegra_cpuidle_probe(struct platform_device *pdev)* is disabled. */ if (!IS_ENABLED (CONFIG_PM_SLEEP )) { -if (!tegra_cpuidle_using_firmware ()) -tegra_cpuidle_disable_state (TEGRA_C7 ); - +tegra_cpuidle_disable_state (TEGRA_C7 );tegra_cpuidle_disable_state (TEGRA_CC6 ); }
Signature · 1 line
2.29.2