diff options
| author | Michael Hennerich <michael.hennerich@analog.com> | 2008-02-02 02:10:51 -0500 | 
|---|---|---|
| committer | Bryan Wu <bryan.wu@analog.com> | 2008-02-02 02:10:51 -0500 | 
| commit | 6cda2e90588ba2f70543abf68b4815e10c86aef1 (patch) | |
| tree | c4fbcc726fd4996848716538583ac0a30ba6f2e5 | |
| parent | a680ae9bdd8746ea4338e843db388fa67f1d1920 (diff) | |
[Blackfin] arch: Fix BUG - 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
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
| -rw-r--r-- | arch/blackfin/kernel/setup.c | 18 | 
1 files changed, 10 insertions, 8 deletions
| diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 2f156bfc2b2c..aca5e6e5bbdd 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c | |||
| @@ -48,6 +48,8 @@ | |||
| 48 | #include <asm/fixed_code.h> | 48 | #include <asm/fixed_code.h> | 
| 49 | #include <asm/early_printk.h> | 49 | #include <asm/early_printk.h> | 
| 50 | 50 | ||
| 51 | static DEFINE_PER_CPU(struct cpu, cpu_devices); | ||
| 52 | |||
| 51 | u16 _bfin_swrst; | 53 | u16 _bfin_swrst; | 
| 52 | 54 | ||
| 53 | unsigned long memory_start, memory_end, physical_mem_end; | 55 | unsigned long memory_start, memory_end, physical_mem_end; | 
| @@ -763,15 +765,15 @@ void __init setup_arch(char **cmdline_p) | |||
| 763 | 765 | ||
| 764 | static int __init topology_init(void) | 766 | static int __init topology_init(void) | 
| 765 | { | 767 | { | 
| 766 | #if defined (CONFIG_BF561) | 768 | int cpu; | 
| 767 | static struct cpu cpu[2]; | 769 | |
| 768 | register_cpu(&cpu[0], 0); | 770 | for_each_possible_cpu(cpu) { | 
| 769 | register_cpu(&cpu[1], 1); | 771 | struct cpu *c = &per_cpu(cpu_devices, cpu); | 
| 772 | |||
| 773 | register_cpu(c, cpu); | ||
| 774 | } | ||
| 775 | |||
| 770 | return 0; | 776 | return 0; | 
| 771 | #else | ||
| 772 | static struct cpu cpu[1]; | ||
| 773 | return register_cpu(cpu, 0); | ||
| 774 | #endif | ||
| 775 | } | 777 | } | 
| 776 | 778 | ||
| 777 | subsys_initcall(topology_init); | 779 | subsys_initcall(topology_init); | 
