[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XEN PATCH v1] x86/cpufreq: separate powernow/hwp cpufreq code



On 04.06.2024 11:34, Sergiy Kibrik wrote:
> --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
> +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
> @@ -657,7 +657,7 @@ static int __init cf_check cpufreq_driver_init(void)
>  
>          case X86_VENDOR_AMD:
>          case X86_VENDOR_HYGON:
> -            ret = powernow_register_driver();
> +            ret = IS_ENABLED(CONFIG_AMD) ? powernow_register_driver() : 
> -ENODEV;
>              break;
>          }

What about the Intel-specific code immediately up from here?
Dealing with that as well may likely permit to reduce ...

> --- a/xen/include/acpi/cpufreq/cpufreq.h
> +++ b/xen/include/acpi/cpufreq/cpufreq.h
> @@ -252,6 +252,7 @@ void cpufreq_dbs_timer_resume(void);
>  
>  void intel_feature_detect(struct cpufreq_policy *policy);
>  
> +#ifdef CONFIG_INTEL
>  int hwp_cmdline_parse(const char *s, const char *e);
>  int hwp_register_driver(void);
>  bool hwp_active(void);
> @@ -260,4 +261,35 @@ int get_hwp_para(unsigned int cpu,
>  int set_hwp_para(struct cpufreq_policy *policy,
>                   struct xen_set_cppc_para *set_cppc);
>  
> +#else
> +
> +static inline int hwp_cmdline_parse(const char *s, const char *e)
> +{
> +    return -EINVAL;
> +}
> +
> +static inline int hwp_register_driver(void)
> +{
> +    return -ENODEV;
> +}
> +
> +static inline bool hwp_active(void)
> +{
> +    return false;
> +}
> +
> +static inline int get_hwp_para(unsigned int cpu,
> +                               struct xen_cppc_para *cppc_para)
> +{
> +    return -EINVAL;
> +}
> +
> +static inline int set_hwp_para(struct cpufreq_policy *policy,
> +                               struct xen_set_cppc_para *set_cppc)
> +{
> +    return -EINVAL;
> +}
> +
> +#endif /* CONFIG_INTEL */

... the number of stubs you're adding here.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.