Re: [PATCH 2/2] cpufreq: intel_pstate: Support highest performance change interrupt

From: srinivas pandruvada
Date: Tue Jun 18 2024 - 07:22:01 EST


Hi Borislav,

On Tue, 2024-06-18 at 11:08 +0200, Borislav Petkov wrote:
> On Mon, Jun 17, 2024 at 08:51:21PM -0700, Srinivas Pandruvada wrote:
> > +       status_mask = HWP_GUARANTEED_PERF_CHANGE_STATUS;
> > +       if (boot_cpu_has(X86_FEATURE_HWP_HIGHEST_PERF_CHANGE))
>
> s/boot_cpu_has/cpu_feature_enabled/g

I will change in V2

> > +               status_mask |= HWP_HIGHEST_PERF_CHANGE_STATUS;
> > +
> >         rdmsrl_safe(MSR_HWP_STATUS, &value);
> > -       if (!(value & 0x01))
> > +       if (!(value & status_mask))
> >                 return;
> >  
> >         spin_lock_irqsave(&hwp_notify_lock, flags);
> > @@ -1668,17 +1675,25 @@ static void
> > intel_pstate_disable_hwp_interrupt(struct cpudata *cpudata)
> >                 cancel_delayed_work_sync(&cpudata-
> > >hwp_notify_work);
> >  }
> >  
> > +#define HWP_GUARANTEED_PERF_CHANGE_REQ BIT(0)
> > +#define HWP_HIGHEST_PERF_CHANGE_REQ    BIT(2)
> > +
> >  static void intel_pstate_enable_hwp_interrupt(struct cpudata
> > *cpudata)
> >  {
> > -       /* Enable HWP notification interrupt for guaranteed
> > performance change */
> > +       /* Enable HWP notification interrupt for performance change
> > */
> >         if (boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) {
> > +               u64 interrupt_mask =
> > HWP_GUARANTEED_PERF_CHANGE_REQ;
> > +
> >                 spin_lock_irq(&hwp_notify_lock);
> >                 INIT_DELAYED_WORK(&cpudata->hwp_notify_work,
> > intel_pstate_notify_work);
> >                 cpumask_set_cpu(cpudata->cpu,
> > &hwp_intr_enable_mask);
> >                 spin_unlock_irq(&hwp_notify_lock);
> >  
> > +               if
> > (boot_cpu_has(X86_FEATURE_HWP_HIGHEST_PERF_CHANGE))a
>
> Ditto.

Will change in v2.


Thanks,
Srinivas