All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin J. Bligh" <mbligh@aracnet.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] (3/7) changes do_boot_cpu to return an error code
Date: Tue, 07 Jan 2003 12:21:54 -0800	[thread overview]
Message-ID: <595690000.1041970914@titus> (raw)

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.


diff -urpN -X /home/fletch/.diff.exclude 02-i386_caching_topo/arch/i386/kernel/smpboot.c 03-boot_error/arch/i386/kernel/smpboot.c
--- 02-i386_caching_topo/arch/i386/kernel/smpboot.c	Tue Jan  7 09:24:51 2003
+++ 03-boot_error/arch/i386/kernel/smpboot.c	Tue Jan  7 09:25:53 2003
@@ -810,14 +810,15 @@ wakeup_secondary_cpu(int phys_apicid, un

 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
  * (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;
-	unsigned long boot_error = 0;
+	unsigned long boot_error;
 	int timeout, cpu;
 	unsigned long start_eip;
 	unsigned short nmi_high, nmi_low;
@@ -883,14 +884,9 @@ static void __init do_boot_cpu (int apic
 	}

 	/*
-	 * Status is now clean
-	 */
-	boot_error = 0;
-
-	/*
 	 * Starting actual IPI sequence...
 	 */
-	wakeup_secondary_cpu(apicid, start_eip);
+	boot_error = wakeup_secondary_cpu(apicid, start_eip);

 	if (!boot_error) {
 		/*
@@ -946,6 +942,7 @@ static void __init do_boot_cpu (int apic
 		*((volatile unsigned short *) TRAMPOLINE_HIGH) = nmi_high;
 		*((volatile unsigned short *) TRAMPOLINE_LOW) = nmi_low;
 	}
+	return boot_error;
 }

 cycles_t cacheflush_time;
@@ -1117,13 +1114,7 @@ static void __init smp_boot_cpus(unsigne
 		if (max_cpus <= cpucount+1)
 			continue;

-		do_boot_cpu(apicid);
-
-		/*
-		 * Make sure we unmap all failed CPUs
-		 */
-		if ((boot_apicid_to_cpu(apicid) == -1) &&
-				(phys_cpu_present_map & (1 << bit)))
+		if (do_boot_cpu(apicid))
 			printk("CPU #%d not responding - cannot use it.\n",
 								apicid);
 	}


             reply	other threads:[~2003-01-07 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-07 20:21 Martin J. Bligh [this message]
2003-01-07 21:49 ` [PATCH] (3/7) changes do_boot_cpu to return an error code Martin J. Bligh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=595690000.1041970914@titus \
    --to=mbligh@aracnet.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.