diff mbox series

[RESEND,v2,2/2] cpuidle: tegra: Remove do_idle firmware call

Message ID 20210302095405.28453-2-digetx@gmail.com (mailing list archive)
State Awaiting Upstream
Delegated to: Daniel Lezcano
Headers show
Series [RESEND,v2,1/2] cpuidle: tegra: Fix C7 idling state on Tegra114 | expand

Commit Message

Dmitry Osipenko March 2, 2021, 9:54 a.m. UTC
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 <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 | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Daniel Lezcano March 2, 2021, 12:45 p.m. UTC | #1
On 02/03/2021 10:54, Dmitry Osipenko wrote:
> 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 <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 | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegra.c
> index 29c5e83500d3..508bd9f23792 100644
> --- a/drivers/cpuidle/cpuidle-tegra.c
> +++ b/drivers/cpuidle/cpuidle-tegra.c
> @@ -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);

So firmware_ops->do_idle is always NULL, thus
tegra_cpuidle_using_firmware() is always false and
tegra_cpuidle_disable_state() always called, right ?


> +		tegra_cpuidle_disable_state(TEGRA_C7);
>  		tegra_cpuidle_disable_state(TEGRA_CC6);
>  	}
>  
>
Dmitry Osipenko March 2, 2021, 12:51 p.m. UTC | #2
02.03.2021 15:45, Daniel Lezcano пишет:
> On 02/03/2021 10:54, Dmitry Osipenko wrote:
>> 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 <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 | 13 +------------
>>  1 file changed, 1 insertion(+), 12 deletions(-)
>>
>> diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegra.c
>> index 29c5e83500d3..508bd9f23792 100644
>> --- a/drivers/cpuidle/cpuidle-tegra.c
>> +++ b/drivers/cpuidle/cpuidle-tegra.c
>> @@ -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);
> 
> So firmware_ops->do_idle is always NULL, thus
> tegra_cpuidle_using_firmware() is always false and
> tegra_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 March 2, 2021, 12:57 p.m. UTC | #3
On 02/03/2021 13:51, Dmitry Osipenko wrote:
> 02.03.2021 15:45, Daniel Lezcano пишет:
>> On 02/03/2021 10:54, Dmitry Osipenko wrote:
>>> 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 <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>
>>> ---

[ ... ]

>>>  	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 ?
> 
> Yes, the tegra_cpuidle_disable_state(TEGRA_C7) is always
> called if CONFIG_PM_SLEEP is disabled in kernel config.

Ok, thanks.

Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Daniel Lezcano March 4, 2021, 2:22 p.m. UTC | #4
On 02/03/2021 10:54, Dmitry Osipenko wrote:
> 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 <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>
> ---

Applied, thanks
diff mbox series

Patch

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