Commit cbda465e authored by Martin J. Bligh's avatar Martin J. Bligh Committed by Linus Torvalds

[PATCH] changes do_boot_cpu to return an error code

Patch from James Cleverdon

Changes do_boot_cpu to return an error code, instead of trying to
work it out later by magic and voodoo. Removes the other usage
of apicid->cpu which is hard to maintain cleanly.
parent ff479131
...@@ -810,14 +810,15 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) ...@@ -810,14 +810,15 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip)
extern unsigned long cpu_initialized; extern unsigned long cpu_initialized;
static void __init do_boot_cpu (int apicid) static int __init do_boot_cpu(int apicid)
/* /*
* NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad
* (ie clustered apic addressing mode), this is a LOGICAL apic ID. * (ie clustered apic addressing mode), this is a LOGICAL apic ID.
* Returns zero if CPU booted OK, else error code from wakeup_secondary_cpu.
*/ */
{ {
struct task_struct *idle; struct task_struct *idle;
unsigned long boot_error = 0; unsigned long boot_error;
int timeout, cpu; int timeout, cpu;
unsigned long start_eip; unsigned long start_eip;
unsigned short nmi_high, nmi_low; unsigned short nmi_high, nmi_low;
...@@ -882,15 +883,10 @@ static void __init do_boot_cpu (int apicid) ...@@ -882,15 +883,10 @@ static void __init do_boot_cpu (int apicid)
apic_read(APIC_ESR); apic_read(APIC_ESR);
} }
/*
* Status is now clean
*/
boot_error = 0;
/* /*
* Starting actual IPI sequence... * Starting actual IPI sequence...
*/ */
wakeup_secondary_cpu(apicid, start_eip); boot_error = wakeup_secondary_cpu(apicid, start_eip);
if (!boot_error) { if (!boot_error) {
/* /*
...@@ -946,6 +942,7 @@ static void __init do_boot_cpu (int apicid) ...@@ -946,6 +942,7 @@ static void __init do_boot_cpu (int apicid)
*((volatile unsigned short *) TRAMPOLINE_HIGH) = nmi_high; *((volatile unsigned short *) TRAMPOLINE_HIGH) = nmi_high;
*((volatile unsigned short *) TRAMPOLINE_LOW) = nmi_low; *((volatile unsigned short *) TRAMPOLINE_LOW) = nmi_low;
} }
return boot_error;
} }
cycles_t cacheflush_time; cycles_t cacheflush_time;
...@@ -1117,13 +1114,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus) ...@@ -1117,13 +1114,7 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
if (max_cpus <= cpucount+1) if (max_cpus <= cpucount+1)
continue; continue;
do_boot_cpu(apicid); if (do_boot_cpu(apicid))
/*
* Make sure we unmap all failed CPUs
*/
if ((boot_apicid_to_cpu(apicid) == -1) &&
(phys_cpu_present_map & (1 << bit)))
printk("CPU #%d not responding - cannot use it.\n", printk("CPU #%d not responding - cannot use it.\n",
apicid); apicid);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment