aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/of.h
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-06-04 01:04:34 -0400
committerGrant Likely <grant.likely@secretlab.ca>2012-06-15 14:08:00 -0400
commit5ca4db61e859526b2dbee3bcea3626d3de49a0b2 (patch)
treeabbe2bc14d1de334834b1c5ace2cbbaf2b7c1b45 /include/linux/of.h
parentefd68e7254503f3207805f674a1ea1d743f5dfe2 (diff)
irqdomain: Simple NUMA awareness.
While common irqdesc allocation is node aware, the irqdomain code is not. Presently we observe a number of regressions/inconsistencies on NUMA-capable platforms: - Platforms using irqdomains with legacy mappings, where the irq_descs are allocated node-local and the irqdomain data structure is not. - Drivers implementing irqdomains will lose node locality regardless of the underlying struct device's node id. This plugs in NUMA node id proliferation across the various allocation callsites by way of_node_to_nid() node lookup. While of_node_to_nid() does the right thing for OF-capable platforms it doesn't presently handle the non-DT case. This is trivially dealt with by simply wraping in to numa_node_id() unconditionally. Signed-off-by: Paul Mundt <lethal@linux-sh.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'include/linux/of.h')
-rw-r--r--include/linux/of.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/of.h b/include/linux/of.h
index 1012377cae92..76930ee78db5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -21,6 +21,7 @@
21#include <linux/kref.h> 21#include <linux/kref.h>
22#include <linux/mod_devicetable.h> 22#include <linux/mod_devicetable.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/topology.h>
24 25
25#include <asm/byteorder.h> 26#include <asm/byteorder.h>
26#include <asm/errno.h> 27#include <asm/errno.h>
@@ -158,11 +159,6 @@ static inline unsigned long of_read_ulong(const __be32 *cell, int size)
158 159
159#define OF_BAD_ADDR ((u64)-1) 160#define OF_BAD_ADDR ((u64)-1)
160 161
161#ifndef of_node_to_nid
162static inline int of_node_to_nid(struct device_node *np) { return -1; }
163#define of_node_to_nid of_node_to_nid
164#endif
165
166static inline const char* of_node_full_name(struct device_node *np) 162static inline const char* of_node_full_name(struct device_node *np)
167{ 163{
168 return np ? np->full_name : "<no-node>"; 164 return np ? np->full_name : "<no-node>";
@@ -412,6 +408,15 @@ static inline int of_machine_is_compatible(const char *compat)
412 while (0) 408 while (0)
413#endif /* CONFIG_OF */ 409#endif /* CONFIG_OF */
414 410
411#ifndef of_node_to_nid
412static inline int of_node_to_nid(struct device_node *np)
413{
414 return numa_node_id();
415}
416
417#define of_node_to_nid of_node_to_nid
418#endif
419
415/** 420/**
416 * of_property_read_bool - Findfrom a property 421 * of_property_read_bool - Findfrom a property
417 * @np: device node from which the property value is to be read. 422 * @np: device node from which the property value is to be read.