On 27.05.2025 10:48, Penny Zheng wrote:
> --- a/xen/drivers/acpi/pmstat.c
> +++ b/xen/drivers/acpi/pmstat.c
> @@ -253,7 +253,8 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
>      else
>          strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
>  
> -    if ( !hwp_active() )
> +    /* bypass hwp and amd-cppc-epp driver */

Nit (comment style): Want to start with a capital letter. See ./CODING_STYLE.

> +    if ( !hwp_active() && cpufreq_driver.setpolicy == NULL )

We generally prefer the shorter "!cpufreq_driver.setpolicy".

And then - is using the presence of that hook really a good criteria to use
here (and below)?

> @@ -346,7 +347,8 @@ static int set_cpufreq_para(struct xen_sysctl_pm_op *op)
>      if ( !policy || !policy->governor )
>          return -EINVAL;
>  
> -    if ( hwp_active() )
> +    /* bypass hwp and amd-cppc-epp driver */
> +    if ( hwp_active() || cpufreq_driver.setpolicy == NULL )
>          return -EOPNOTSUPP;

Isn't this the wrong way round? I.e. don't you mean "!= NULL" (or the equivalent
thereof) here?

Jan

Reply via email to