diff options
author | Rojhalat Ibrahim <imr@rtschenk.de> | 2006-02-20 08:35:27 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2006-02-21 11:58:23 -0500 |
commit | 1e35aabab82f8a6f7ab884b642e68be260f92f2c (patch) | |
tree | 0daef6084bb1b35f40d129245579dc358df480fb /arch/mips/kernel | |
parent | 76e1daee7db153400aaed55646e05a312da353b3 (diff) |
[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/mips/kernel')
-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 25472fcaf715..5e189862e523 100644 --- a/arch/mips/kernel/smp.c +++ b/arch/mips/kernel/smp.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/timex.h> | 29 | #include <linux/timex.h> |
30 | #include <linux/sched.h> | 30 | #include <linux/sched.h> |
31 | #include <linux/cpumask.h> | 31 | #include <linux/cpumask.h> |
32 | #include <linux/cpu.h> | ||
32 | 33 | ||
33 | #include <asm/atomic.h> | 34 | #include <asm/atomic.h> |
34 | #include <asm/cpu.h> | 35 | #include <asm/cpu.h> |
@@ -424,6 +425,25 @@ void flush_tlb_one(unsigned long vaddr) | |||
424 | local_flush_tlb_one(vaddr); | 425 | local_flush_tlb_one(vaddr); |
425 | } | 426 | } |
426 | 427 | ||
428 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | ||
429 | |||
430 | static int __init topology_init(void) | ||
431 | { | ||
432 | int cpu; | ||
433 | int ret; | ||
434 | |||
435 | for_each_cpu(cpu) { | ||
436 | ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL); | ||
437 | if (ret) | ||
438 | printk(KERN_WARNING "topology_init: register_cpu %d " | ||
439 | "failed (%d)\n", cpu, ret); | ||
440 | } | ||
441 | |||
442 | return 0; | ||
443 | } | ||
444 | |||
445 | subsys_initcall(topology_init); | ||
446 | |||
427 | EXPORT_SYMBOL(flush_tlb_page); | 447 | EXPORT_SYMBOL(flush_tlb_page); |
428 | EXPORT_SYMBOL(flush_tlb_one); | 448 | EXPORT_SYMBOL(flush_tlb_one); |
429 | EXPORT_SYMBOL(cpu_data); | 449 | EXPORT_SYMBOL(cpu_data); |