aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/topology.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-06-06 22:29:37 -0400
committerPaul Mundt <lethal@hera.kernel.org>2007-06-07 22:43:50 -0400
commit05a117847b43d44f336bbf272a1063661431a5e5 (patch)
tree7eaf33d0e1964c9bea59dcba4bdedbc5f76b2366 /arch/sh/kernel/topology.c
parent5bbeafca8d5c64b6d9c6653993492d763be0918f (diff)
sh: Fix up cpu to node mapping in sysfs.
Currently cpu_to_node() is always 0 in the UP case, though we do want to have the CPU association linked in under sysfs even in the cases where we're only on a single CPU. Fix this up, so we have the cpu0 link on all of the available nodes that don't already have a CPU link of their own. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/topology.c')
-rw-r--r--arch/sh/kernel/topology.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c
index 9687b02caf4b..9b5844a1bdaa 100644
--- a/arch/sh/kernel/topology.c
+++ b/arch/sh/kernel/topology.c
@@ -1,3 +1,12 @@
1/*
2 * arch/sh/kernel/topology.c
3 *
4 * Copyright (C) 2007 Paul Mundt
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
1#include <linux/cpu.h> 10#include <linux/cpu.h>
2#include <linux/cpumask.h> 11#include <linux/cpumask.h>
3#include <linux/init.h> 12#include <linux/init.h>
@@ -23,6 +32,18 @@ static int __init topology_init(void)
23 __FUNCTION__, i, ret); 32 __FUNCTION__, i, ret);
24 } 33 }
25 34
35#if defined(CONFIG_NUMA) && !defined(CONFIG_SMP)
36 /*
37 * In the UP case, make sure the CPU association is still
38 * registered under each node. Without this, sysfs fails
39 * to make the connection between nodes other than node0
40 * and cpu0.
41 */
42 for_each_online_node(i)
43 if (i != numa_node_id())
44 register_cpu_under_node(raw_smp_processor_id(), i);
45#endif
46
26 return 0; 47 return 0;
27} 48}
28subsys_initcall(topology_init); 49subsys_initcall(topology_init);