RE: [RFC][PATCH] cpuidle: Consolidate disabled state checks

Doug Smythies
2019-09-20T16:15:00Z

Hi Rafael,

To be able to try this patch (and the nanosecond as unit of time one),
I simply waited until it would apply properly in the main git tree, which it now does.

However it does not compile:

On 2019.09.04 03:41 Rafael J. Wysocki wrote:

...

> Index: linux-pm/drivers/cpuidle/governors/menu.c
> ===================================================================
> --- linux-pm.orig/drivers/cpuidle/governors/menu.c
> +++ linux-pm/drivers/cpuidle/governors/menu.c
> @@ -298,7 +298,7 @@ static int menu_select(struct cpuidle_dr
> if (unlikely(drv->state_count <= 1 || latency_req == 0) ||
> ((data->next_timer_us < drv->states[1].target_residency ||
> latency_req < drv->states[1].exit_latency) &&
> - !drv->states[0].disabled && !dev->states_usage[0].disable)) {
> + !dev->states_usage[0].disable)) {
> /*
> * In this case state[0] will be used no matter what, so return
> * it right away and keep the tick running if state[0] is a
> @@ -349,9 +349,8 @@ static int menu_select(struct cpuidle_dr
> idx = -1;
> for (i = 0; i < drv->state_count; i++) {
> struct cpuidle_state *s = &drv->states[i];
> - struct cpuidle_state_usage *su = &dev->states_usage[i];
>
> - if (s->disabled || su->disable)
> + if (dev->states_usage[i]->disable)
^^^^^^^^^^
Should be (I think):
+ if (dev->states_usage[i].disable)

... Doug