[IA64] Do not call SN_SAL_SET_CPU_NUMBER twice on cpu 0

This is an SN specific patch.

Architectually, cpu_init is always called twice on cpu 0
and thus resulted in two SN_SAL_SET_CPU_NUMBER calls.

This was harmless in production kernel; however, it can
cause problem on booting up a crashdump kernel at Altix.

Here is the patch that detects the second sn_cpu_init
call and skips the second call to SN_SAL_SET_CPU_NUMBER.

Signed-Off-By: Jay Lan <jlan@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by Jay Lan and committed by Tony Luck adf142e3 3640543d

+10 -2
+10 -2
arch/ia64/sn/kernel/setup.c
··· 580 580 int slice; 581 581 int cnode; 582 582 int i; 583 - static int wars_have_been_checked; 583 + static int wars_have_been_checked, set_cpu0_number; 584 584 585 585 cpuid = smp_processor_id(); 586 586 if (cpuid == 0 && IS_MEDUSA()) { ··· 605 605 /* 606 606 * Don't check status. The SAL call is not supported on all PROMs 607 607 * but a failure is harmless. 608 + * Architechtuallly, cpu_init is always called twice on cpu 0. We 609 + * should set cpu_number on cpu 0 once. 608 610 */ 609 - (void) ia64_sn_set_cpu_number(cpuid); 611 + if (cpuid == 0) { 612 + if (!set_cpu0_number) { 613 + (void) ia64_sn_set_cpu_number(cpuid); 614 + set_cpu0_number = 1; 615 + } 616 + } else 617 + (void) ia64_sn_set_cpu_number(cpuid); 610 618 611 619 /* 612 620 * The boot cpu makes this call again after platform initialization is