public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Jay Lan <jlan@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] Do not call SN_SAL_SET_CPU_NUMBER twice on cpu 0
Date: Mon, 11 Dec 2006 23:39:23 +0000	[thread overview]
Message-ID: <457DEC2B.3060104@sgi.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 442 bytes --]

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>

The patch is created off 2.6.19.


[-- Attachment #2: dont-set-cpu0-number-twice --]
[-- Type: text/plain, Size: 1072 bytes --]

Index: linux/arch/ia64/sn/kernel/setup.c
===================================================================
--- linux.orig/arch/ia64/sn/kernel/setup.c	2006-11-29 13:57:37.000000000 -0800
+++ linux/arch/ia64/sn/kernel/setup.c	2006-12-11 15:31:16.700848251 -0800
@@ -562,7 +562,7 @@ void __cpuinit sn_cpu_init(void)
 	int slice;
 	int cnode;
 	int i;
-	static int wars_have_been_checked;
+	static int wars_have_been_checked, set_cpu0_number;
 
 	cpuid = smp_processor_id();
 	if (cpuid == 0 && IS_MEDUSA()) {
@@ -587,8 +587,16 @@ void __cpuinit sn_cpu_init(void)
 	/*
 	 * Don't check status. The SAL call is not supported on all PROMs
 	 * but a failure is harmless.
+	 * Architechtuallly, cpu_init is always called twice on cpu 0. We
+	 * should set cpu_number on cpu 0 once.
 	 */
-	(void) ia64_sn_set_cpu_number(cpuid);
+	if (cpuid == 0) {
+		if (!set_cpu0_number) {
+			(void) ia64_sn_set_cpu_number(cpuid);
+			set_cpu0_number = 1;
+		}
+	} else
+		(void) ia64_sn_set_cpu_number(cpuid);
 
 	/*
 	 * The boot cpu makes this call again after platform initialization is

                 reply	other threads:[~2006-12-11 23:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=457DEC2B.3060104@sgi.com \
    --to=jlan@sgi.com \
    --cc=linux-ia64@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox