diff options
author | Rojhalat Ibrahim <imr@rtschenk.de> | 2006-02-20 13:35:27 (GMT) |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-02-21 16:58:23 (GMT) |
commit | 1e35aabab82f8a6f7ab884b642e68be260f92f2c (patch) | |
tree | 0daef6084bb1b35f40d129245579dc358df480fb /arch | |
parent | 76e1daee7db153400aaed55646e05a312da353b3 (diff) | |
download | linux-fsl-qoriq-1e35aabab82f8a6f7ab884b642e68be260f92f2c.tar.xz |
[MIPS] Add topology_init.
A recent patch introduced cpu topology in sysfs. When you run a kernel
with SMP and sysfs enabled, you now get an Oops on boot. The following
patch fixes that by adding topology_init to arch/mips/kernel/smp.c. The
code is copied from arch/s390/kernel/smp.c.
Signed-off-by: Rojhalat Ibrahim <imr@rtschenk.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/smp.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c index 25472fc..5e18986 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c @@ -29,6 +29,7 @@ #include <linux/timex.h> #include <linux/sched.h> #include <linux/cpumask.h> +#include <linux/cpu.h> #include <asm/atomic.h> #include <asm/cpu.h> @@ -424,6 +425,25 @@ void flush_tlb_one(unsigned long vaddr) local_flush_tlb_one(vaddr); } +static DEFINE_PER_CPU(struct cpu, cpu_devices); + +static int __init topology_init(void) +{ + int cpu; + int ret; + + for_each_cpu(cpu) { + ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); + if (ret) + printk(KERN_WARNING "topology_init: register_cpu %d " + "failed (%d)\n", cpu, ret); + } + + return 0; +} + +subsys_initcall(topology_init); + EXPORT_SYMBOL(flush_tlb_page); EXPORT_SYMBOL(flush_tlb_one); EXPORT_SYMBOL(cpu_data); |