cpuidle: tegra: Fix C7 idling state on Tegra114
Subsystems (2)
PATCH RESEND v2 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.
---
Changelog:
v2: - No changes. V1 got no attention, hence re-sending.
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 RESEND v2 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.
---
Changelog:
v2: - No changes. V1 got no attention, hence re-sending.
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
Re: [PATCH RESEND v2 2/2] cpuidle: tegra: Remove do_idle firmware call
Quoted 44 lines · Dmitry Osipenko
The
do_idlefirmware call is unused by all Tegra SoCs, hence remove it in order to keep driver's code clean.Signed-off-by Dmitry Osipenko <[email protected]>---
Changelog:
v2: - No changes. V1 got no attention, hence re-sending.
drivers/cpuidle/cpuidle-tegra.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)drivers/cpuidle/cpuidle-tegra.c +0
-9@@ -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); }
drivers/cpuidle/cpuidle-tegra.c static int tegra_cpuidle_probe(struct platform_device *pdev) · line 360
Quoted 5 lines
drivers/cpuidle/cpuidle-tegra.c +0
-2@@ -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 );
So firmware_ops->do_idle is always NULL, thus tegra_cpuidle_using_firmware() is always false and tegra_cpuidle_disable_state() always called, right ?
Quoted 5 lines
drivers/cpuidle/cpuidle-tegra.c +1
-0+tegra_cpuidle_disable_state (TEGRA_C7 );tegra_cpuidle_disable_state (TEGRA_CC6 ); }
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH RESEND v2 2/2] cpuidle: tegra: Remove do_idle firmware call
02.03.2021 15:45, Daniel Lezcano пишет:
Quoted 44 lines · Dmitry Osipenko
Quoted 43 lines
The
do_idlefirmware call is unused by all Tegra SoCs, hence remove it in order to keep driver's code clean.Signed-off-by Dmitry Osipenko <[email protected]>---
Changelog:
v2: - No changes. V1 got no attention, hence re-sending.
drivers/cpuidle/cpuidle-tegra.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-)drivers/cpuidle/cpuidle-tegra.c +0
-9@@ -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); }
Quoted 10 lines
drivers/cpuidle/cpuidle-tegra.c static int tegra_cpuidle_probe(struct platform_device *pdev) · line 360
Quoted 6 lines
drivers/cpuidle/cpuidle-tegra.c +0
-2@@ -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 );So
firmware_ops->do_idleis always NULL, thustegra_cpuidle_using_firmware()is always false andtegra_cpuidle_disable_state()always called, right ?
Yes, the tegra_cpuidle_disable_state(TEGRA_C7) is always called if CONFIG_PM_SLEEP is disabled in kernel config.
Daniel Lezcano
Reviewed-byRe: [PATCH RESEND v2 2/2] cpuidle: tegra: Remove do_idle firmware call
Quoted 10 lines · Dmitry Osipenko
02.03.2021 15:45, Daniel Lezcano пишет:
Quoted 9 lines · Dmitry Osipenko
Quoted 8 lines
The
do_idlefirmware call is unused by all Tegra SoCs, hence remove it in order to keep driver's code clean.Signed-off-by Dmitry Osipenko <[email protected]>---
[ ... ]
Quoted 10 lines
Quoted 7 lines
drivers/cpuidle/cpuidle-tegra.c static int tegra_cpuidle_probe(struct platform_device *pdev) · line 360
Quoted 3 lines
drivers/cpuidle/cpuidle-tegra.c +0
-2if (!IS_ENABLED (CONFIG_PM_SLEEP )) { -if (!tegra_cpuidle_using_firmware ()) -tegra_cpuidle_disable_state (TEGRA_C7 );So
firmware_ops->do_idleis always NULL, thustegra_cpuidle_using_firmware()is always false andtegra_cpuidle_disable_state()always called, right ?Yes, the
tegra_cpuidle_disable_state(TEGRA_C7)is always called ifCONFIG_PM_SLEEPis disabled in kernel config.
Ok, thanks.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Daniel Lezcano
AppliedRe: [PATCH RESEND v2 2/2] cpuidle: tegra: Remove do_idle firmware call
In reply to Dmitry OsipenkoQuoted 8 lines · Dmitry Osipenko
The
do_idlefirmware call is unused by all Tegra SoCs, hence remove it in order to keep driver's code clean.Signed-off-by Dmitry Osipenko <[email protected]>---
Applied, thanks
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Quoted 6 lines · Dmitry Osipenko
Trusted Foundation firmware doesn't implement the
do_idlecall and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set theNOFLUSH_L2mode 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.
Quoted 7 lines
Fixes 14e086baca50 ("cpuidle: tegra: Squash Tegra114 driver into the common driver")Cc [email protected] # 5.7+Reported-by Anton Bambura <[email protected]> # TF701 T114Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 34 lines
---
Changelog:
v2: - No changes. V1 got no attention, hence re-sending.
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 · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rafael J. Wysocki
maintainerQuoted 16 lines · Daniel Lezcano
Quoted 6 lines · Dmitry Osipenko
Trusted Foundation firmware doesn't implement the
do_idlecall and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set theNOFLUSH_L2mode 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.Quoted 7 lines
Fixes 14e086baca50 ("cpuidle: tegra: Squash Tegra114 driver into the common driver")Cc [email protected] # 5.7+Reported-by Anton Bambura <[email protected]> # TF701 T114Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 1 line
Reviewed-by Daniel Lezcano <[email protected]>
So do I gather correctly that I am expected to pick up this series?
Quoted 17 lines · Rafael J. Wysocki
Quoted 16 lines · Daniel Lezcano
Quoted 13 lines · Dmitry Osipenko
Trusted Foundation firmware doesn't implement the
do_idlecall and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set theNOFLUSH_L2mode 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]> # TF701 T114Signed-off-by Dmitry Osipenko <[email protected]>
Quoted 3 lines
Quoted 1 line
Reviewed-by Daniel Lezcano <[email protected]>So do I gather correctly that I am expected to pick up this series?
I had picked the cpuidle related patches in the past. As the traffic became low, I assumed you directly pick them.
But I can take care of them and send a PR at -rc5 like before, especially that we have new driver coming. It is not a problem.
Let me know what is you preferred way.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Rafael J. Wysocki
maintainerQuoted 23 lines · Daniel Lezcano
Quoted 17 lines · Rafael J. Wysocki
Quoted 16 lines · Daniel Lezcano
Quoted 13 lines · Dmitry Osipenko
Trusted Foundation firmware doesn't implement the
do_idlecall and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set theNOFLUSH_L2mode 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]> # TF701 T114Signed-off-by Dmitry Osipenko <[email protected]>Quoted 3 lines
Quoted 1 line
Reviewed-by Daniel Lezcano <[email protected]>So do I gather correctly that I am expected to pick up this series?
Quoted 7 lines
I had picked the cpuidle related patches in the past. As the traffic became low, I assumed you directly pick them.
But I can take care of them and send a PR at -rc5 like before, especially that we have new driver coming. It is not a problem.
Let me know what is you preferred way.
If you can take care of ARM-specific cpuidle changes, that'll help.
Thanks!
Quoted 27 lines · Rafael J. Wysocki
Quoted 26 lines · Daniel Lezcano
Quoted 17 lines · Rafael J. Wysocki
Quoted 16 lines · Daniel Lezcano
Quoted 13 lines · Dmitry Osipenko
Trusted Foundation firmware doesn't implement the
do_idlecall and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set theNOFLUSH_L2mode 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]> # TF701 T114Signed-off-by Dmitry Osipenko <[email protected]>Quoted 3 lines
Quoted 1 line
Reviewed-by Daniel Lezcano <[email protected]>So do I gather correctly that I am expected to pick up this series?
I had picked the cpuidle related patches in the past. As the traffic became low, I assumed you directly pick them.
Quoted 6 lines
Quoted 4 lines
But I can take care of them and send a PR at -rc5 like before, especially that we have new driver coming. It is not a problem.
Let me know what is you preferred way.
If you can take care of ARM-specific cpuidle changes, that'll help.
No problem, thanks
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Daniel Lezcano
AppliedQuoted 6 lines · Dmitry Osipenko
Trusted Foundation firmware doesn't implement the
do_idlecall and in this case suspending should fall back to the common suspend path. In order to fix this issue we will unconditionally set theNOFLUSH_L2mode 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.
Quoted 7 lines
Fixes 14e086baca50 ("cpuidle: tegra: Squash Tegra114 driver into the common driver")Cc [email protected] # 5.7+Reported-by Anton Bambura <[email protected]> # TF701 T114Signed-off-by Dmitry Osipenko <[email protected]>
Applied, thanks
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog