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

Re: [Xen-devel] [PATCH v4 05/11] x86/intel_pstate: relocate the driver register function



>>> On 25.06.15 at 13:16, <wei.w.wang@xxxxxxxxx> wrote:
> Register the CPU hotplug notifier when the driver is
> registered, and move the driver register function to
> the cpufreq.c.

At the very least this ought to be merged with the previous patch.

> --- a/xen/drivers/cpufreq/cpufreq.c
> +++ b/xen/drivers/cpufreq/cpufreq.c
> @@ -630,10 +630,18 @@ static struct notifier_block cpu_nfb = {
>      .notifier_call = cpu_callback
>  };
>  
> -static int __init cpufreq_presmp_init(void)
> +int cpufreq_register_driver(struct cpufreq_driver *driver_data)
>  {
> +    if (!driver_data || !driver_data->init ||
> +        !driver_data->verify || !driver_data->exit ||
> +        (!driver_data->target == !driver_data->setpolicy))
> +        return -EINVAL;
> +
> +    if (cpufreq_driver)
> +        return -EBUSY;
> +
> +    cpufreq_driver = driver_data;
> +
>      register_cpu_notifier(&cpu_nfb);
>      return 0;
>  }
> -presmp_initcall(cpufreq_presmp_init);

But then the code is left inconsistent: When will the notifier be
called for all the CPUs that are already up?

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®.