[PATCH] alpha: SMP IRQ routing fix

From: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

After removal of fixup_cpu_present_map() function Alpha ended up with an empty
cpu_present_map, so secondary CPUs on SMP systems are not being started.

Worse, on some platforms we route interrupts to secondary CPUs using
cpu_possible_map which is still populated properly. As a result, these
interrupts go nowhere so the machines like DP264 aren't able to boot even with
a primary CPU.

Fixed basically by s/cpu_present_mask/cpu_present_map/.

Thanks to Ernst Herzberg for reporting the bug and testing the fix.

Cc: Ernst Herzberg <list-lkml@net4u.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Ivan Kokshaysky and committed by
Linus Torvalds
c7d2d28b ba0c19ed

+9 -18
-1
arch/alpha/kernel/alpha_ksyms.c
··· 182 182 EXPORT_SYMBOL(smp_call_function); 183 183 EXPORT_SYMBOL(smp_call_function_on_cpu); 184 184 EXPORT_SYMBOL(_atomic_dec_and_lock); 185 - EXPORT_SYMBOL(cpu_present_mask); 186 185 #endif /* CONFIG_SMP */ 187 186 188 187 /*
+3 -3
arch/alpha/kernel/process.c
··· 94 94 if (cpuid != boot_cpuid) { 95 95 flags |= 0x00040000UL; /* "remain halted" */ 96 96 *pflags = flags; 97 - clear_bit(cpuid, &cpu_present_mask); 97 + cpu_clear(cpuid, cpu_present_map); 98 98 halt(); 99 99 } 100 100 #endif ··· 120 120 121 121 #ifdef CONFIG_SMP 122 122 /* Wait for the secondaries to halt. */ 123 - cpu_clear(boot_cpuid, cpu_possible_map); 124 - while (cpus_weight(cpu_possible_map)) 123 + cpu_clear(boot_cpuid, cpu_present_map); 124 + while (cpus_weight(cpu_present_map)) 125 125 barrier(); 126 126 #endif 127 127
+4 -10
arch/alpha/kernel/smp.c
··· 68 68 static int smp_secondary_alive __initdata = 0; 69 69 70 70 /* Which cpus ids came online. */ 71 - cpumask_t cpu_present_mask; 72 71 cpumask_t cpu_online_map; 73 72 74 73 EXPORT_SYMBOL(cpu_online_map); ··· 438 439 if ((cpu->flags & 0x1cc) == 0x1cc) { 439 440 smp_num_probed++; 440 441 /* Assume here that "whami" == index */ 441 - cpu_set(i, cpu_present_mask); 442 + cpu_set(i, cpu_present_map); 442 443 cpu->pal_revision = boot_cpu_palrev; 443 444 } 444 445 ··· 449 450 } 450 451 } else { 451 452 smp_num_probed = 1; 452 - cpu_set(boot_cpuid, cpu_present_mask); 453 453 } 454 454 455 - printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", 456 - smp_num_probed, cpu_possible_map.bits[0]); 455 + printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_map = %lx\n", 456 + smp_num_probed, cpu_present_map.bits[0]); 457 457 } 458 458 459 459 /* ··· 471 473 472 474 /* Nothing to do on a UP box, or when told not to. */ 473 475 if (smp_num_probed == 1 || max_cpus == 0) { 474 - cpu_present_mask = cpumask_of_cpu(boot_cpuid); 476 + cpu_present_map = cpumask_of_cpu(boot_cpuid); 475 477 printk(KERN_INFO "SMP mode deactivated.\n"); 476 478 return; 477 479 } ··· 484 486 void __devinit 485 487 smp_prepare_boot_cpu(void) 486 488 { 487 - /* 488 - * Mark the boot cpu (current cpu) as online 489 - */ 490 - cpu_set(smp_processor_id(), cpu_online_map); 491 489 } 492 490 493 491 int __devinit
+1 -1
arch/alpha/kernel/sys_titan.c
··· 66 66 register int bcpu = boot_cpuid; 67 67 68 68 #ifdef CONFIG_SMP 69 - cpumask_t cpm = cpu_present_mask; 69 + cpumask_t cpm = cpu_present_map; 70 70 volatile unsigned long *dim0, *dim1, *dim2, *dim3; 71 71 unsigned long mask0, mask1, mask2, mask3, dummy; 72 72
+1 -3
include/asm-alpha/smp.h
··· 45 45 #define hard_smp_processor_id() __hard_smp_processor_id() 46 46 #define raw_smp_processor_id() (current_thread_info()->cpu) 47 47 48 - extern cpumask_t cpu_present_mask; 49 - extern cpumask_t cpu_online_map; 50 48 extern int smp_num_cpus; 51 - #define cpu_possible_map cpu_present_mask 49 + #define cpu_possible_map cpu_present_map 52 50 53 51 int smp_call_function_on_cpu(void (*func) (void *info), void *info,int retry, int wait, cpumask_t cpu); 54 52