public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v2 1/2] cpuidle: tegra: Fix C7 idling state on Tegra114
@ 2021-03-02  9:54 Dmitry Osipenko
  2021-03-02  9:54 ` [PATCH RESEND v2 2/2] cpuidle: tegra: Remove do_idle firmware call Dmitry Osipenko
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Dmitry Osipenko @ 2021-03-02  9:54 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Rafael J. Wysocki,
	Daniel Lezcano, Anton Bambura, Matt Merhar, Peter Geis
  Cc: linux-pm, linux-tegra

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: stable@vger.kernel.org # 5.7+
Reported-by: Anton Bambura <jenneron@protonmail.com> # TF701 T114
Tested-by: Anton Bambura <jenneron@protonmail.com> # TF701 T114
Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30
Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---

Changelog:

v2: - No changes. V1 got no attention, hence re-sending.

 drivers/cpuidle/cpuidle-tegra.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegra.c
index 191966dc8d02..29c5e83500d3 100644
--- a/drivers/cpuidle/cpuidle-tegra.c
+++ b/drivers/cpuidle/cpuidle-tegra.c
@@ -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);
 }
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-03-04 14:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-02  9:54 [PATCH RESEND v2 1/2] cpuidle: tegra: Fix C7 idling state on Tegra114 Dmitry Osipenko
2021-03-02  9:54 ` [PATCH RESEND v2 2/2] cpuidle: tegra: Remove do_idle firmware call Dmitry Osipenko
2021-03-02 12:45   ` Daniel Lezcano
2021-03-02 12:51     ` Dmitry Osipenko
2021-03-02 12:57       ` Daniel Lezcano
2021-03-04 14:22   ` Daniel Lezcano
2021-03-02 12:36 ` [PATCH RESEND v2 1/2] cpuidle: tegra: Fix C7 idling state on Tegra114 Daniel Lezcano
2021-03-04 13:55   ` Rafael J. Wysocki
2021-03-04 14:05     ` Daniel Lezcano
2021-03-04 14:08       ` Rafael J. Wysocki
2021-03-04 14:09         ` Daniel Lezcano
2021-03-04 14:21 ` Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox