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

Re: [Xen-devel] [PATCH v2 7/9] x86/intel_pstate: add a booting param to select the driver to load



>>> On 13.05.16 at 09:51, <wei.w.wang@xxxxxxxxx> wrote:
> --- a/xen/arch/x86/acpi/cpufreq/cpufreq.c
> +++ b/xen/arch/x86/acpi/cpufreq/cpufreq.c
> @@ -650,9 +650,12 @@ static int __init cpufreq_driver_init(void)
>      int ret = 0;
>  
>      if ((cpufreq_controller == FREQCTL_xen) &&
> -        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL))
> -        ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> -    else if ((cpufreq_controller == FREQCTL_xen) &&
> +        (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL)) {
> +        if (load_intel_pstate)
> +            ret = intel_pstate_init();
> +        if (!load_intel_pstate)
> +            ret = cpufreq_register_driver(&acpi_cpufreq_driver);

I don't see why you need load_intel_pstate here: Simply call the
original function whenever intel_pstate_init() returns an error.

> --- a/xen/arch/x86/acpi/cpufreq/intel_pstate.c
> +++ b/xen/arch/x86/acpi/cpufreq/intel_pstate.c
> @@ -766,6 +766,8 @@ static struct cpufreq_driver intel_pstate_driver = {
>      .name         = "intel_pstate",
>  };
>  
> +int __initdata load_intel_pstate = 0;

static bool_t

> @@ -850,3 +856,14 @@ out:
>      xfree(all_cpu_data);
>      return -ENODEV;
>  }
> +
> +static int __init intel_pstate_setup(char *str)
> +{
> +    if (!str)
> +        return -EINVAL;
> +    if (!strcmp(str, "enable"))
> +        load_intel_pstate = 1;
> +
> +    return 0;
> +}
> +custom_param("intel_pstate", intel_pstate_setup);

This is an ordinary boolean_param().

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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