Re: [RFC PATCH v4 6/8] intel_idle: Provide enter_dead() handler for SRF

From: Peter Zijlstra
Date: Mon Nov 25 2024 - 09:18:50 EST


On Mon, Nov 25, 2024 at 02:58:50PM +0100, Rafael J. Wysocki wrote:

> > @@ -2143,10 +2143,15 @@ static void __init intel_idle_init_cstates_icpu(struct cpuidle_driver *drv)
> > if (intel_idle_max_cstate_reached(cstate))
> > break;
> >
> > - if (!cpuidle_state_table[cstate].enter &&
> > - !cpuidle_state_table[cstate].enter_s2idle)
> > + if (!cpuidle_state_table[cstate].enter)
> > break;
> >
> > + if (!cpuidle_state_table[cstate].enter_dead)
> > + cpuidle_state_table[cstate].enter_dead = intel_idle_enter_dead;
> > +
> > + if (!cpuidle_state_table[cstate].enter_s2idle)
> > + cpuidle_state_table[cstate].enter_s2idle = intel_idle_s2idle;
> > +
> > /* If marked as unusable, skip this state. */
> > if (cpuidle_state_table[cstate].flags & CPUIDLE_FLAG_UNUSABLE) {
> > pr_debug("state %s is disabled\n",
>
> You can do the same thing with :enter() I think? And it doesn't need
> to be in one go.

!enter is used as a terminator.

And it's harder to not do everything in one go; regex ftw :-)