public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Dobson <colpatch@us.ibm.com>
To: linux-kernel@vger.kernel.org, John Stultz <johnstul@us.ibm.com>,
	"Martin J. Bligh" <mbligh@aracnet.com>,
	Andrew Morton <akpm@digeo.com>, Dave Hansen <haveblue@us.ibm.com>
Subject: [patch] Make 16-way x440's boot
Date: Tue, 12 Aug 2003 10:51:16 -0700	[thread overview]
Message-ID: <3F392914.1010704@us.ibm.com> (raw)

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

16 proc x440 boxen aren't booting mainline kernels right now for many 
valid configs.  This patch makes sure NUMA codepaths aren't executed for 
SMP configs.  It also adds some sane error messages to the code, and 
cleans up some #ifdefs.  Please apply.

[mcd@arrakis src]$ diffstat ~/patches/16way-x440_fix.patch
  arch/i386/kernel/setup.c                    |    3 ---
  arch/i386/kernel/summit.c                   |   18 ++++++++++++++----
  include/asm-i386/mach-summit/mach_mpparse.h |    8 ++++++++
  3 files changed, 22 insertions(+), 7 deletions(-)


Cheers!

-Matt

[-- Attachment #2: 16way-x440_fix.patch --]
[-- Type: text/plain, Size: 3828 bytes --]

diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.0t3-bk1/arch/i386/kernel/setup.c linux-2.6.0t3-16way-x440/arch/i386/kernel/setup.c
--- linux-2.6.0t3-bk1/arch/i386/kernel/setup.c	Fri Aug  8 21:36:40 2003
+++ linux-2.6.0t3-16way-x440/arch/i386/kernel/setup.c	Tue Aug 12 10:38:52 2003
@@ -989,9 +989,6 @@ void __init setup_arch(char **cmdline_p)
 	if (smp_found_config)
 		get_smp_config();
 #endif
-#ifdef CONFIG_X86_SUMMIT
-	setup_summit();
-#endif
 
 	register_memory(max_low_pfn);
 
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.0t3-bk1/arch/i386/kernel/summit.c linux-2.6.0t3-16way-x440/arch/i386/kernel/summit.c
--- linux-2.6.0t3-bk1/arch/i386/kernel/summit.c	Fri Aug  8 21:36:46 2003
+++ linux-2.6.0t3-16way-x440/arch/i386/kernel/summit.c	Tue Aug 12 10:43:43 2003
@@ -31,6 +31,7 @@
 #include <asm/io.h>
 #include <mach_mpparse.h>
 
+#ifdef CONFIG_NUMA
 static void __init setup_pci_node_map_for_wpeg(int wpeg_num, struct rio_table_hdr *rth, 
 		struct scal_detail **scal_nodes, struct rio_detail **rio_nodes){
 	int twst_num = 0, node = 0, first_bus = 0;
@@ -93,15 +94,21 @@ static void __init setup_pci_node_map_fo
 		mp_bus_id_to_node[bus] = node;
 }
 
-static void __init build_detail_arrays(struct rio_table_hdr *rth,
+static int __init build_detail_arrays(struct rio_table_hdr *rth,
 		struct scal_detail **sd, struct rio_detail **rd){
 	unsigned long ptr;
 	int i, scal_detail_size, rio_detail_size;
 
+	if ((rth->num_scal_dev > MAX_NUMNODES) || 
+	    (rth->num_rio_dev > MAX_NUMNODES * 2)){
+		printk("%s: MAX_NUMNODES too low!  Defined as %d, but system has %d nodes.\n", __FUNCTION__, MAX_NUMNODES, rth->num_scal_dev);
+		return 1;
+	}
+
 	switch (rth->version){
 	default:
 		printk("%s: Bad Rio Grande Table Version: %d\n", __FUNCTION__, rth->version);
-		/* Fall through to default to version 2 spec */
+		return 1;
 	case 2:
 		scal_detail_size = 11;
 		rio_detail_size = 13;
@@ -119,6 +126,8 @@ static void __init build_detail_arrays(s
 	ptr += scal_detail_size * rth->num_scal_dev;
 	for(i = 0; i < rth->num_rio_dev; i++)
 		rd[i] = (struct rio_detail *)(ptr + (rio_detail_size * i));
+
+	return 0;
 }
 
 void __init setup_summit(void)
@@ -152,11 +161,12 @@ void __init setup_summit(void)
 		return;
 	}
 
-	/* Deal with the ugly version 2/3 pointer arithmetic */
-	build_detail_arrays(rio_table_hdr, scal_devs, rio_devs);
+	if (build_detail_arrays(rio_table_hdr, scal_devs, rio_devs))
+		return;
 
 	for(i = 0; i < rio_table_hdr->num_rio_dev; i++)
 		if (is_WPEG(rio_devs[i]->type))
 			/* It's a Winnipeg, it's got PCI Busses */
 			setup_pci_node_map_for_wpeg(i, rio_table_hdr, scal_devs, rio_devs);
 }
+#endif /* CONFIG_NUMA */
diff -Nurp --exclude-from=/home/mcd/.dontdiff linux-2.6.0t3-bk1/include/asm-i386/mach-summit/mach_mpparse.h linux-2.6.0t3-16way-x440/include/asm-i386/mach-summit/mach_mpparse.h
--- linux-2.6.0t3-bk1/include/asm-i386/mach-summit/mach_mpparse.h	Fri Aug  8 21:36:02 2003
+++ linux-2.6.0t3-16way-x440/include/asm-i386/mach-summit/mach_mpparse.h	Tue Aug 12 10:38:52 2003
@@ -5,6 +5,12 @@
 
 extern int use_cyclone;
 
+#ifdef CONFIG_NUMA
+extern void setup_summit(void);
+#else /* !CONFIG_NUMA */
+#define setup_summit()	{}
+#endif /* CONFIG_NUMA */
+
 static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 
 				struct mpc_config_translation *translation)
 {
@@ -24,6 +30,7 @@ static inline int mps_oem_check(struct m
 			 || !strncmp(productid, "EXA", 3)
 			 || !strncmp(productid, "RUTHLESS SMP", 12))){
 		use_cyclone = 1; /*enable cyclone-timer*/
+		setup_summit();
 		return 1;
 	}
 	return 0;
@@ -36,6 +43,7 @@ static inline int acpi_madt_oem_check(ch
 	    (!strncmp(oem_table_id, "SERVIGIL", 8)
 	     || !strncmp(oem_table_id, "EXA", 3))){
 		use_cyclone = 1; /*enable cyclone-timer*/
+		setup_summit();
 		return 1;
 	}
 	return 0;

                 reply	other threads:[~2003-08-12 17:52 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=3F392914.1010704@us.ibm.com \
    --to=colpatch@us.ibm.com \
    --cc=akpm@digeo.com \
    --cc=haveblue@us.ibm.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@aracnet.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox