]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
of: return NUMA_NO_NODE from fallback of_node_to_nid()
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Wed, 8 Apr 2015 16:59:20 +0000 (19:59 +0300)
committerGrant Likely <grant.likely@linaro.org>
Thu, 4 Jun 2015 05:39:52 +0000 (14:39 +0900)
Node 0 might be offline as well as any other numa node,
in this case kernel cannot handle memory allocation and crashes.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Fixes: 0c3f061c195c ("of: implement of_node_to_nid as a weak function")
Signed-off-by: Grant Likely <grant.likely@linaro.org>
drivers/of/base.c
include/linux/of.h

index 99764db0875aa0e1b34ca348ca1606c2a8990258..8e39b38ca206214ac7cf462c5f7b2c99078f32ae 100644 (file)
@@ -89,7 +89,7 @@ EXPORT_SYMBOL(of_n_size_cells);
 #ifdef CONFIG_NUMA
 int __weak of_node_to_nid(struct device_node *np)
 {
-       return numa_node_id();
+       return NUMA_NO_NODE;
 }
 #endif
 
index ddeaae6d2083b256b21b930f3eed8182510e26a8..ab071742c0c4e1f726aa8be2b58773e6d94b48ed 100644 (file)
@@ -667,7 +667,10 @@ static inline void of_property_clear_flag(struct property *p, unsigned long flag
 #if defined(CONFIG_OF) && defined(CONFIG_NUMA)
 extern int of_node_to_nid(struct device_node *np);
 #else
-static inline int of_node_to_nid(struct device_node *device) { return 0; }
+static inline int of_node_to_nid(struct device_node *device)
+{
+       return NUMA_NO_NODE;
+}
 #endif
 
 static inline struct device_node *of_find_matching_node(