[PATCH v2 2/4] cpuidle: haltpoll: Remove single state handling

Aboorva Devarajan posted 4 patches 2 weeks, 2 days ago
[PATCH v2 2/4] cpuidle: haltpoll: Remove single state handling
Posted by Aboorva Devarajan 2 weeks, 2 days ago
cpuidle systems where the governor has no choice because there's only
a single idle state are now handled by cpuidle core and bypass the
governor, so remove the related handling.

Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
---
 drivers/cpuidle/governors/haltpoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c
index 663b7f164d20..ed3952df8526 100644
--- a/drivers/cpuidle/governors/haltpoll.c
+++ b/drivers/cpuidle/governors/haltpoll.c
@@ -52,7 +52,7 @@ static int haltpoll_select(struct cpuidle_driver *drv,
 {
 	s64 latency_req = cpuidle_governor_latency_req(dev->cpu);
 
-	if (!drv->state_count || latency_req == 0) {
+	if (latency_req == 0) {
 		*stop_tick = false;
 		return 0;
 	}
-- 
2.52.0
Re: [PATCH v2 2/4] cpuidle: haltpoll: Remove single state handling
Posted by Christian Loehle 2 weeks, 1 day ago
On 2/16/26 18:50, Aboorva Devarajan wrote:
> cpuidle systems where the governor has no choice because there's only
> a single idle state are now handled by cpuidle core and bypass the
> governor, so remove the related handling.
> 
> Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>

Good catch, thanks!
Reviewed-by: Christian Loehle <christian.loehle@arm.com>

> ---
>  drivers/cpuidle/governors/haltpoll.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpuidle/governors/haltpoll.c b/drivers/cpuidle/governors/haltpoll.c
> index 663b7f164d20..ed3952df8526 100644
> --- a/drivers/cpuidle/governors/haltpoll.c
> +++ b/drivers/cpuidle/governors/haltpoll.c
> @@ -52,7 +52,7 @@ static int haltpoll_select(struct cpuidle_driver *drv,
>  {
>  	s64 latency_req = cpuidle_governor_latency_req(dev->cpu);
>  
> -	if (!drv->state_count || latency_req == 0) {
> +	if (latency_req == 0) {
>  		*stop_tick = false;
>  		return 0;
>  	}