* [PATCH] Add topology_init
@ 2006-02-20 13:28 Rojhalat Ibrahim
2006-02-20 13:52 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Rojhalat Ibrahim @ 2006-02-20 13:28 UTC (permalink / raw)
To: linux-mips
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>
--- 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,24 @@ 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);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] Add topology_init
2006-02-20 13:28 [PATCH] Add topology_init Rojhalat Ibrahim
@ 2006-02-20 13:52 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2006-02-20 13:52 UTC (permalink / raw)
To: Rojhalat Ibrahim; +Cc: linux-mips
On Mon, Feb 20, 2006 at 02:28:32PM +0100, Rojhalat Ibrahim wrote:
> 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>
Thanks, applied.
Your mailer converts tabs to space (Or did you do cut and paste?), which
made git think your patch was corrupt and so I had to apply it manually ...
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-02-20 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-20 13:28 [PATCH] Add topology_init Rojhalat Ibrahim
2006-02-20 13:52 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.