Message ID | 520A7B00.8060405@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, 2013-08-13 at 19:29 +0100, Sudeep KarkadaNagesha wrote: > I don't understand completely the use of ibm,ppc-interrupt-server#s and > its implications on generic of_get_cpu_node implementation. > I see the PPC specific definition of of_get_cpu_node uses thread id only > in 2 instances. Based on that, I have tried to move all the other > instances to use generic definition. > > Let me know if the idea is correct. No. The device-tree historically only represents cores, not HW threads, so it makes sense to retrieve also the thread number corresponding to the CPU. However, the mechanism to represent HW threads in the device-tree is currently somewhat platform specific (the ibm,ppc-interrupt-server#s). So what you could do for now is: - Have a generic version that always returns 0 as the thread, which is weak - powerpc keeps its own implementation - Start a discussion on the bindings (if not already there) to define threads in a better way at which point the generic function can be updated. Cheers, Ben.
On 13/08/13 22:07, Benjamin Herrenschmidt wrote: > On Tue, 2013-08-13 at 19:29 +0100, Sudeep KarkadaNagesha wrote: >> I don't understand completely the use of ibm,ppc-interrupt-server#s and >> its implications on generic of_get_cpu_node implementation. >> I see the PPC specific definition of of_get_cpu_node uses thread id only >> in 2 instances. Based on that, I have tried to move all the other >> instances to use generic definition. >> >> Let me know if the idea is correct. > > No. The device-tree historically only represents cores, not HW threads, so > it makes sense to retrieve also the thread number corresponding to the CPU. > Ok > However, the mechanism to represent HW threads in the device-tree is currently > somewhat platform specific (the ibm,ppc-interrupt-server#s). I see most of the callers pass NULL to thread id argument except 2 instances in entire tree. If that's the case why can't we move to use generic of_get_cpu_node in most of those cases and have PPC specific implementation for the ones using thread id. > > So what you could do for now is: > > - Have a generic version that always returns 0 as the thread, which is weak I would prefer to move to generic of_get_cpu_node where ever possible and rename the function that takes thread id rather than making generic one weak. > > - powerpc keeps its own implementation How about only in cases where it needs thread_id. > > - Start a discussion on the bindings (if not already there) to define threads > in a better way at which point the generic function can be updated. > I am not sure if we need to define any new bindings. Excerpts from ePAPR (v1.1): "3.7.1 General Properties of CPU nodes The value of "reg" is a <prop-encoded-array> that defines a unique CPU/thread id for the CPU/threads represented by the CPU node. If a CPU supports more than one thread (i.e. multiple streams of execution) the reg property is an array with 1 element per thread. The #address-cells on the /cpus node specifies how many cells each element of the array takes. Software can determine the number of threads by dividing the size of reg by the parent node's #address-cells." And this is exactly in agreement to what's implemented in the generic of_get_cpu_node: for_each_child_of_node(cpus, cpun) { if (of_node_cmp(cpun->type, "cpu")) continue; cell = of_get_property(cpun, "reg", &prop_len); if (!cell) { pr_warn("%s: missing reg property\n", cpun->full_name); continue; } prop_len /= sizeof(*cell); while (prop_len) { hwid = of_read_number(cell, ac); prop_len -= ac; if (arch_match_cpu_phys_id(cpu, hwid)) return cpun; } } Yes this doesn't cover the historical "ibm,ppc-interrupt-server#s", for which we can have PPC specific wrapper above the generic one i.e. get the cpu node and then parse for thread id under custom property. Let me know your thoughts. Regards, Sudeep
On Wed, 2013-08-14 at 11:01 +0100, Sudeep KarkadaNagesha wrote: > Yes this doesn't cover the historical "ibm,ppc-interrupt-server#s", > for > which we can have PPC specific wrapper above the generic one i.e. get > the cpu node and then parse for thread id under custom property. A wrapper is wrong. I don't want to have to have all ppc callers to use a different function. As I said, just make a generic one that returns a thread ID, ie, same signature as the powerpc one. Make it weak, we can override it in powerpc-land, or we can move the ibm,ppc-interrupt-server#s handling into the generic one, it won't hurt, but leave the thread_id return there, it doesn't hurt it will come in handy in a few cases without causing code duplication. Cheers, Ben.
On 08/14/2013 05:01 AM, Sudeep KarkadaNagesha wrote: > On 13/08/13 22:07, Benjamin Herrenschmidt wrote: >> On Tue, 2013-08-13 at 19:29 +0100, Sudeep KarkadaNagesha wrote: >>> I don't understand completely the use of ibm,ppc-interrupt-server#s and >>> its implications on generic of_get_cpu_node implementation. >>> I see the PPC specific definition of of_get_cpu_node uses thread id only >>> in 2 instances. Based on that, I have tried to move all the other >>> instances to use generic definition. >>> >>> Let me know if the idea is correct. >> >> No. The device-tree historically only represents cores, not HW threads, so >> it makes sense to retrieve also the thread number corresponding to the CPU. >> > Ok > >> However, the mechanism to represent HW threads in the device-tree is currently >> somewhat platform specific (the ibm,ppc-interrupt-server#s). > I see most of the callers pass NULL to thread id argument except 2 > instances in entire tree. If that's the case why can't we move to use > generic of_get_cpu_node in most of those cases and have PPC specific > implementation for the ones using thread id. > >> >> So what you could do for now is: >> >> - Have a generic version that always returns 0 as the thread, which is weak > I would prefer to move to generic of_get_cpu_node where ever possible > and rename the function that takes thread id rather than making generic > one weak. > >> >> - powerpc keeps its own implementation > How about only in cases where it needs thread_id. > >> >> - Start a discussion on the bindings (if not already there) to define threads >> in a better way at which point the generic function can be updated. >> > I am not sure if we need to define any new bindings. Excerpts from ePAPR > (v1.1): > "3.7.1 General Properties of CPU nodes > The value of "reg" is a <prop-encoded-array> that defines a unique > CPU/thread id for the CPU/threads represented by the CPU node. > If a CPU supports more than one thread (i.e. multiple streams of > execution) the reg property is an array with 1 element per thread. The > #address-cells on the /cpus node specifies how many cells each element > of the array takes. Software can determine the number of threads by > dividing the size of reg by the parent node's #address-cells." > > And this is exactly in agreement to what's implemented in the generic > of_get_cpu_node: > > for_each_child_of_node(cpus, cpun) { > if (of_node_cmp(cpun->type, "cpu")) > continue; > cell = of_get_property(cpun, "reg", &prop_len); > if (!cell) { > pr_warn("%s: missing reg property\n", cpun->full_name); > continue; > } > prop_len /= sizeof(*cell); > while (prop_len) { > hwid = of_read_number(cell, ac); > prop_len -= ac; > if (arch_match_cpu_phys_id(cpu, hwid)) > return cpun; > } > } How about something like this: for_each_child_of_node(cpus, cpun) { if (of_node_cmp(cpun->type, "cpu")) continue; if (arch_of_get_cpu_node(cpun, thread)) return cpun; cell = of_get_property(cpun, "reg", &prop_len); if (!cell) { pr_warn("%s: missing reg property\n", cpun->full_name); continue; } prop_len /= sizeof(*cell); while (prop_len) { hwid = of_read_number(cell, ac); prop_len -= ac; if (arch_match_cpu_phys_id(cpu, hwid)) return cpun; } } For PPC: arch_of_get_cpu_node() { const u32 *intserv; unsigned int plen, t; /* Check for ibm,ppc-interrupt-server#s. */ intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &plen); if (!intserv) return false; hardid = get_hard_smp_processor_id(cpu); plen /= sizeof(u32); for (t = 0; t < plen; t++) { if (hardid == intserv[t]) { if (thread) *thread = t; return true; } } return false; } > > Yes this doesn't cover the historical "ibm,ppc-interrupt-server#s", for > which we can have PPC specific wrapper above the generic one i.e. get > the cpu node and then parse for thread id under custom property. > > Let me know your thoughts. > > Regards, > Sudeep > > >
On 14/08/13 12:37, Benjamin Herrenschmidt wrote: > On Wed, 2013-08-14 at 11:01 +0100, Sudeep KarkadaNagesha wrote: >> Yes this doesn't cover the historical "ibm,ppc-interrupt-server#s", >> for >> which we can have PPC specific wrapper above the generic one i.e. get >> the cpu node and then parse for thread id under custom property. > > A wrapper is wrong. I don't want to have to have all ppc callers to use > a different function. Ok. On the side note the main intention of this patch series[1] is to avoid calling of_get_cpu_node function once CPU devices are registered. It initialises the of_node in all the cpu devices using this function when registering the CPU device. It can be retrieved from cpu_dev->of_node. So direct users of of_get_cpu_node can be reduced to avoid unnecessary parsing of DT to find cpu node. > > As I said, just make a generic one that returns a thread ID, ie, same > signature as the powerpc one. Make it weak, we can override it in > powerpc-land, IMO, making generic definition which adhere to the ePAPR specification as weak is not so clean. > or we can move the ibm,ppc-interrupt-server#s handling > into the generic one, it won't hurt, but leave the thread_id return > there, it doesn't hurt it will come in handy in a few cases without > causing code duplication. > IMO moving of handling ibm,ppc-interrupt-server#s to generic code under #ifdef CONFIG_PPC seems to be cleaner approach than weak definitation. As per my understanding each thread is a different logical cpu. Each logical cpu is mapped to unique physical id(either present in reg field or legacy ibm,ppc-interrupt-server#s field). So given a logical cpu id we can get the cpu node corresponding to it. Looking @ smp_setup_cpu_maps in arch/powerpc/kernel/setup-common.c and the comment in the same file: "This implementation only supports power of 2 number of threads.." the thread id id is implicit in the logical cpu id. Do we need to fetch that from DT ? Regards, Sudeep [1] https://lkml.org/lkml/2013/7/22/219
On 14/08/13 13:53, Rob Herring wrote: > On 08/14/2013 05:01 AM, Sudeep KarkadaNagesha wrote: >> On 13/08/13 22:07, Benjamin Herrenschmidt wrote: >>> On Tue, 2013-08-13 at 19:29 +0100, Sudeep KarkadaNagesha wrote: >>>> I don't understand completely the use of ibm,ppc-interrupt-server#s and >>>> its implications on generic of_get_cpu_node implementation. >>>> I see the PPC specific definition of of_get_cpu_node uses thread id only >>>> in 2 instances. Based on that, I have tried to move all the other >>>> instances to use generic definition. >>>> >>>> Let me know if the idea is correct. >>> >>> No. The device-tree historically only represents cores, not HW threads, so >>> it makes sense to retrieve also the thread number corresponding to the CPU. >>> >> Ok >> >>> However, the mechanism to represent HW threads in the device-tree is currently >>> somewhat platform specific (the ibm,ppc-interrupt-server#s). >> I see most of the callers pass NULL to thread id argument except 2 >> instances in entire tree. If that's the case why can't we move to use >> generic of_get_cpu_node in most of those cases and have PPC specific >> implementation for the ones using thread id. >> >>> >>> So what you could do for now is: >>> >>> - Have a generic version that always returns 0 as the thread, which is weak >> I would prefer to move to generic of_get_cpu_node where ever possible >> and rename the function that takes thread id rather than making generic >> one weak. >> >>> >>> - powerpc keeps its own implementation >> How about only in cases where it needs thread_id. >> >>> >>> - Start a discussion on the bindings (if not already there) to define threads >>> in a better way at which point the generic function can be updated. >>> >> I am not sure if we need to define any new bindings. Excerpts from ePAPR >> (v1.1): >> "3.7.1 General Properties of CPU nodes >> The value of "reg" is a <prop-encoded-array> that defines a unique >> CPU/thread id for the CPU/threads represented by the CPU node. >> If a CPU supports more than one thread (i.e. multiple streams of >> execution) the reg property is an array with 1 element per thread. The >> #address-cells on the /cpus node specifies how many cells each element >> of the array takes. Software can determine the number of threads by >> dividing the size of reg by the parent node's #address-cells." >> >> And this is exactly in agreement to what's implemented in the generic >> of_get_cpu_node: >> >> for_each_child_of_node(cpus, cpun) { >> if (of_node_cmp(cpun->type, "cpu")) >> continue; >> cell = of_get_property(cpun, "reg", &prop_len); >> if (!cell) { >> pr_warn("%s: missing reg property\n", cpun->full_name); >> continue; >> } >> prop_len /= sizeof(*cell); >> while (prop_len) { >> hwid = of_read_number(cell, ac); >> prop_len -= ac; >> if (arch_match_cpu_phys_id(cpu, hwid)) >> return cpun; >> } >> } > > How about something like this: > > for_each_child_of_node(cpus, cpun) { > if (of_node_cmp(cpun->type, "cpu")) > continue; > > if (arch_of_get_cpu_node(cpun, thread)) > return cpun; > > cell = of_get_property(cpun, "reg", &prop_len); > if (!cell) { > pr_warn("%s: missing reg property\n", cpun->full_name); > continue; > } > prop_len /= sizeof(*cell); > while (prop_len) { > hwid = of_read_number(cell, ac); > prop_len -= ac; > if (arch_match_cpu_phys_id(cpu, hwid)) > return cpun; > } > } > > For PPC: > > arch_of_get_cpu_node() > { > const u32 *intserv; > unsigned int plen, t; > > /* Check for ibm,ppc-interrupt-server#s. */ > intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", > &plen); > if (!intserv) > return false; > > hardid = get_hard_smp_processor_id(cpu); > > plen /= sizeof(u32); > for (t = 0; t < plen; t++) { > if (hardid == intserv[t]) { > if (thread) > *thread = t; > return true; > } > } > return false; > } > Sorry responded to earlier mail before seeing this. This approach looks good, but we still need to have thread id as argument which should be fine. But as per my understanding on how logical cpu<->hard proccessor id is setup, the thread_id is implicit in the logical cpu id making it unnecessary to depend on DT each time. Regards, Sudeep >> >> Yes this doesn't cover the historical "ibm,ppc-interrupt-server#s", for >> which we can have PPC specific wrapper above the generic one i.e. get >> the cpu node and then parse for thread id under custom property. >> >> Let me know your thoughts. >> >> Regards, >> Sudeep >> >> >> > >
On Wed, 2013-08-14 at 14:21 +0100, Sudeep KarkadaNagesha wrote: > IMO moving of handling ibm,ppc-interrupt-server#s to generic code > under > #ifdef CONFIG_PPC seems to be cleaner approach than weak definitation. > > As per my understanding each thread is a different logical cpu. > Each logical cpu is mapped to unique physical id(either present in reg > field or legacy ibm,ppc-interrupt-server#s field). So given a logical > cpu id we can get the cpu node corresponding to it. > Looking @ smp_setup_cpu_maps in arch/powerpc/kernel/setup-common.c > and the comment in the same file: "This implementation only supports > power of 2 number of threads.." the thread id id is implicit in the > logical cpu id. Do we need to fetch that from DT ? I don't want those parsing routines to make those assumptions. We have changed our logical numbering in the past and may again. Cheers, Ben.
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h index 42ee294..b48bbfe 100644 --- a/arch/powerpc/include/asm/prom.h +++ b/arch/powerpc/include/asm/prom.h @@ -44,7 +44,7 @@ void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, extern void kdump_move_device_tree(void); /* CPU OF node matching */ -struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); +struct device_node *arch_of_get_cpu_node_by_tid(int cpu, unsigned int *thread); #ifdef CONFIG_NUMA extern int of_node_to_nid(struct device_node *device); diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c index 9262cf2..c60eef9 100644 --- a/arch/powerpc/kernel/cacheinfo.c +++ b/arch/powerpc/kernel/cacheinfo.c @@ -434,7 +434,7 @@ static struct cache *cache_chain_instantiate(unsigned int cpu_id) pr_debug("creating cache object(s) for CPU %i\n", cpu_id); - cpu_node = of_get_cpu_node(cpu_id, NULL); + cpu_node = of_get_cpu_node(cpu_id); WARN_ONCE(!cpu_node, "no OF node found for CPU %i\n", cpu_id); if (!cpu_node) goto out; @@ -764,7 +764,7 @@ static struct cache *cache_lookup_by_cpu(unsigned int cpu_id) struct device_node *cpu_node; struct cache *cache; - cpu_node = of_get_cpu_node(cpu_id, NULL); + cpu_node = of_get_cpu_node(cpu_id); WARN_ONCE(!cpu_node, "no OF node found for CPU %i\n", cpu_id); if (!cpu_node) return NULL; diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c index af09e32..fe48a70 100644 --- a/arch/powerpc/kernel/prom.c +++ b/arch/powerpc/kernel/prom.c @@ -33,6 +33,7 @@ #include <linux/irq.h> #include <linux/memblock.h> #include <linux/of.h> +#include <linux/cpu.h> #include <asm/prom.h> #include <asm/rtas.h> @@ -834,15 +835,23 @@ static int __init prom_reconfig_setup(void) __initcall(prom_reconfig_setup); #endif +bool arch_match_cpu_phys_id(int cpu, u64 phys_id) +{ + return phys_id == get_hard_smp_processor_id(cpu); +} + /* Find the device node for a given logical cpu number, also returns the cpu * local thread number (index in ibm,interrupt-server#s) if relevant and * asked for (non NULL) */ -struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) +struct device_node *arch_of_get_cpunode_by_tid(int cpu, unsigned int *thread) { int hardid; struct device_node *np; + if (thread == NULL) + return of_get_cpu_node(cpu); + hardid = get_hard_smp_processor_id(cpu); for_each_node_by_type(np, "cpu") { @@ -855,14 +864,9 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) intserv = of_get_property(np, "ibm,ppc-interrupt-server#s", &plen); if (intserv == NULL) { - const u32 *reg = of_get_property(np, "reg", NULL); - if (reg == NULL) - continue; - if (*reg == hardid) { - if (thread) - *thread = 0; - return np; - } + np = of_get_cpu_node(cpu); + *thread = 0; + return np; } else { plen /= sizeof(u32); for (t = 0; t < plen; t++) { @@ -876,7 +880,6 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) } return NULL; } -EXPORT_SYMBOL(of_get_cpu_node); #if defined(CONFIG_DEBUG_FS) && defined(DEBUG) static struct debugfs_blob_wrapper flat_dt_blob; diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 38b0ba6..cc0e3a27 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c @@ -560,7 +560,7 @@ int cpu_to_core_id(int cpu) const int *reg; int id = -1; - np = of_get_cpu_node(cpu, NULL); + np = of_get_cpu_node(cpu); if (!np) goto out; @@ -598,7 +598,7 @@ static struct device_node *cpu_to_l2cache(int cpu) if (!cpu_present(cpu)) return NULL; - np = of_get_cpu_node(cpu, NULL); + np = of_get_cpu_node(cpu); if (np == NULL) return NULL; diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c index 5850798..4b06158 100644 --- a/arch/powerpc/mm/numa.c +++ b/arch/powerpc/mm/numa.c @@ -520,7 +520,7 @@ static int of_drconf_to_nid_single(struct of_drconf_cell *drmem, static int numa_setup_cpu(unsigned long lcpu) { int nid = 0; - struct device_node *cpu = of_get_cpu_node(lcpu, NULL); + struct device_node *cpu = of_get_cpu_node(lcpu); if (!cpu) { WARN_ON(1); @@ -699,7 +699,7 @@ static int __init parse_numa_properties(void) struct device_node *cpu; int nid; - cpu = of_get_cpu_node(i, NULL); + cpu = of_get_cpu_node(i); BUG_ON(!cpu); nid = of_node_to_nid_single(cpu); of_node_put(cpu); diff --git a/arch/powerpc/platforms/44x/currituck.c b/arch/powerpc/platforms/44x/currituck.c index 7f1b71a..84eb64e 100644 --- a/arch/powerpc/platforms/44x/currituck.c +++ b/arch/powerpc/platforms/44x/currituck.c @@ -98,7 +98,7 @@ static void smp_ppc47x_setup_cpu(int cpu) static int smp_ppc47x_kick_cpu(int cpu) { - struct device_node *cpunode = of_get_cpu_node(cpu, NULL); + struct device_node *cpunode = of_get_cpu_node(cpu); const u64 *spin_table_addr_prop; u32 *spin_table; extern void start_secondary_47x(void); diff --git a/arch/powerpc/platforms/44x/iss4xx.c b/arch/powerpc/platforms/44x/iss4xx.c index 4241bc8..8195456 100644 --- a/arch/powerpc/platforms/44x/iss4xx.c +++ b/arch/powerpc/platforms/44x/iss4xx.c @@ -88,7 +88,7 @@ static void smp_iss4xx_setup_cpu(int cpu) static int smp_iss4xx_kick_cpu(int cpu) { - struct device_node *cpunode = of_get_cpu_node(cpu, NULL); + struct device_node *cpunode = of_get_cpu_node(cpu); const u64 *spin_table_addr_prop; u32 *spin_table; extern void start_secondary_47x(void); diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c index 5ced4f5..e32c532 100644 --- a/arch/powerpc/platforms/85xx/smp.c +++ b/arch/powerpc/platforms/85xx/smp.c @@ -156,7 +156,7 @@ static int smp_85xx_kick_cpu(int nr) pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr); - np = of_get_cpu_node(nr, NULL); + np = of_get_cpu_node(nr); cpu_rel_addr = of_get_property(np, "cpu-release-addr", NULL); if (cpu_rel_addr == NULL) { diff --git a/arch/powerpc/platforms/cell/cbe_regs.c b/arch/powerpc/platforms/cell/cbe_regs.c index 1428d58..a055b74 100644 --- a/arch/powerpc/platforms/cell/cbe_regs.c +++ b/arch/powerpc/platforms/cell/cbe_regs.c @@ -182,7 +182,7 @@ static struct device_node *cbe_get_be_node(int cpu_id) return np; for (i=0; i<len; i++) - if (of_find_node_by_phandle(cpu_handle[i]) == of_get_cpu_node(cpu_id, NULL)) + if (of_find_node_by_phandle(cpu_handle[i]) == of_get_cpu_node(cpu_id)) return np; } @@ -240,7 +240,8 @@ void __init cbe_regs_init(void) /* Build local fast map of CPUs */ for_each_possible_cpu(i) { - cbe_thread_map[i].cpu_node = of_get_cpu_node(i, &thread_id); + cbe_thread_map[i].cpu_node = + arch_of_get_cpunode_by_tid(i, &thread_id); cbe_thread_map[i].be_node = cbe_get_be_node(i); cbe_thread_map[i].thread_id = thread_id; } diff --git a/arch/powerpc/platforms/wsp/ics.c b/arch/powerpc/platforms/wsp/ics.c index 2d3b1dd..b83bc2e 100644 --- a/arch/powerpc/platforms/wsp/ics.c +++ b/arch/powerpc/platforms/wsp/ics.c @@ -137,7 +137,7 @@ void cpus_on_chip(int chip_id, cpumask_t *mask, cpumask_t *ret) cpumask_clear(ret); for_each_cpu(cpu, mask) { - cpu_dn = of_get_cpu_node(cpu, NULL); + cpu_dn = of_get_cpu_node(cpu); if (!cpu_dn) continue; @@ -649,7 +649,7 @@ static void __init wsp_ics_set_default_server(void) u32 hwid; /* Find the server number for the boot cpu. */ - np = of_get_cpu_node(boot_cpuid, NULL); + np = of_get_cpu_node(boot_cpuid); BUG_ON(!np); hwid = get_hard_smp_processor_id(boot_cpuid); diff --git a/arch/powerpc/platforms/wsp/smp.c b/arch/powerpc/platforms/wsp/smp.c index 332a18b..2abe794 100644 --- a/arch/powerpc/platforms/wsp/smp.c +++ b/arch/powerpc/platforms/wsp/smp.c @@ -40,7 +40,7 @@ int smp_a2_kick_cpu(int nr) if (nr < 0 || nr >= NR_CPUS) return -ENOENT; - np = of_get_cpu_node(nr, &thr_idx); + np = arch_of_get_cpunode_by_tid(nr, &thr_idx); if (!np) return -ENODEV; diff --git a/arch/powerpc/platforms/wsp/wsp.c b/arch/powerpc/platforms/wsp/wsp.c index d25cc96..43a17a2 100644 --- a/arch/powerpc/platforms/wsp/wsp.c +++ b/arch/powerpc/platforms/wsp/wsp.c @@ -90,7 +90,7 @@ void wsp_halt(void) struct device_node *mine; struct device_node *me; - me = of_get_cpu_node(smp_processor_id(), NULL); + me = of_get_cpu_node(smp_processor_id()); mine = scom_find_parent(me); /* This will halt all the A2s but not power off the chip */ diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c index 9049d9f..d16082f 100644 --- a/arch/powerpc/sysdev/xics/xics-common.c +++ b/arch/powerpc/sysdev/xics/xics-common.c @@ -53,7 +53,7 @@ void xics_update_irq_servers(void) u32 hcpuid; /* Find the server numbers for the boot cpu. */ - np = of_get_cpu_node(boot_cpuid, NULL); + np = of_get_cpu_node(boot_cpuid); BUG_ON(!np); hcpuid = get_hard_smp_processor_id(boot_cpuid); diff --git a/drivers/cpufreq/pasemi-cpufreq.c b/drivers/cpufreq/pasemi-cpufreq.c index b704da4..692755f 100644 --- a/drivers/cpufreq/pasemi-cpufreq.c +++ b/drivers/cpufreq/pasemi-cpufreq.c @@ -149,7 +149,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy) struct device_node *cpu, *dn; int err = -ENODEV; - cpu = of_get_cpu_node(policy->cpu, NULL); + cpu = of_get_cpu_node(policy->cpu); if (!cpu) goto out; diff --git a/drivers/cpufreq/ppc-corenet-cpufreq.c b/drivers/cpufreq/ppc-corenet-cpufreq.c index 3cae452..64fb70a 100644 --- a/drivers/cpufreq/ppc-corenet-cpufreq.c +++ b/drivers/cpufreq/ppc-corenet-cpufreq.c @@ -150,7 +150,7 @@ static int corenet_cpufreq_cpu_init(struct cpufreq_policy *policy) struct cpu_data *data; unsigned int cpu = policy->cpu; - np = of_get_cpu_node(cpu, NULL); + np = of_get_cpu_node(cpu); if (!np) return -ENODEV; diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index 5936f8d..0700445 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c @@ -75,7 +75,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) int i, cur_pmode; struct device_node *cpu; - cpu = of_get_cpu_node(policy->cpu, NULL); + cpu = of_get_cpu_node(policy->cpu); if (!cpu)