Title: [4176] branches/2008R1/arch/blackfin/kernel/setup.c: Fix BUG [#3853]
Enable ISP1362 driver to work ok with BF561
- Revision
- 4176
- Author
- hennerich
- Date
- 2008-01-30 08:42:04 -0600 (Wed, 30 Jan 2008)
Log Message
Fix BUG [#3853] Enable ISP1362 driver to work ok with BF561
This fixes a bug (zero pointer access) only seen on BF561, during USB
Mass Storage/SCSI Host initialization.
It appears to be related to registering a none existing CPU.
Diffstat
setup.c | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
Modified Paths
Diff
Modified: branches/2008R1/arch/blackfin/kernel/setup.c (4175 => 4176)
--- branches/2008R1/arch/blackfin/kernel/setup.c 2008-01-30 14:39:04 UTC (rev 4175)
+++ branches/2008R1/arch/blackfin/kernel/setup.c 2008-01-30 14:42:04 UTC (rev 4176)
@@ -47,6 +47,8 @@
#include <asm/fixed_code.h>
#include <asm/early_printk.h>
+static DEFINE_PER_CPU(struct cpu, cpu_devices);
+
u16 _bfin_swrst;
unsigned long memory_start, memory_end, physical_mem_end;
@@ -450,15 +452,15 @@
static int __init topology_init(void)
{
-#if defined (CONFIG_BF561)
- static struct cpu cpu[2];
- register_cpu(&cpu[0], 0);
- register_cpu(&cpu[1], 1);
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
+ struct cpu *c = &per_cpu(cpu_devices, cpu);
+
+ register_cpu(c, cpu);
+ }
+
return 0;
-#else
- static struct cpu cpu[1];
- return register_cpu(cpu, 0);
-#endif
}
subsys_initcall(topology_init);
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits