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

Re: [Xen-devel] [RFC PATCH v4 5/9] cpufreq: cpufreq-cpu0: change cpus data path in devtree for hwdom kernel



On Tue, 4 Nov 2014, Oleksandr Dmytryshyn wrote:
> All information needed for this driver about physical cpus
> now located in /hypervisor/pcpus node instead of the
> /cpus node in case if kernel is running as hardware domain.
> 
> Signed-off-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@xxxxxxxxxxxxxxx>
> ---
>  drivers/cpufreq/cpufreq-cpu0.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
> index ef4fbc4..a83838b 100644
> --- a/drivers/cpufreq/cpufreq-cpu0.c
> +++ b/drivers/cpufreq/cpufreq-cpu0.c
> @@ -21,6 +21,8 @@
>  #include <linux/regulator/consumer.h>
>  #include <linux/slab.h>
>  
> +#include <xen/xen.h>
> +
>  static unsigned int transition_latency;
>  static unsigned int voltage_tolerance; /* in percentage */
>  
> @@ -182,7 +184,13 @@ static int cpu0_cpufreq_probe(struct platform_device 
> *pdev)
>       struct device_node *np;
>       int ret;
>  
> -     np = of_find_node_by_path("/cpus/cpu@0");
> +#ifdef CONFIG_XEN_DOM0

the #ifdef is not necessary, xen_initial_domain() is always properly
defined


> +     if (xen_initial_domain())
> +             np = of_find_node_by_path("/hypervisor/pcpus/cpu@0");
> +     else
> +#endif
> +             np = of_find_node_by_path("/cpus/cpu@0");
>       if (!np) {
>               pr_err("failed to find cpu0 node\n");
>               return -ENOENT;
> -- 
> 1.9.1
> 

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