linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix pSeries identification in prom_init.c
@ 2006-05-15  5:46 Benjamin Herrenschmidt
  2006-05-15  5:51 ` Benjamin Herrenschmidt
  2006-05-15  9:51 ` segher
  0 siblings, 2 replies; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2006-05-15  5:46 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev list

The OF trampoline code prom_init.c still needs to identify IBM pSeries
(PAPR) machines in order to run some platform specific code on them like
instanciating the TCE tables. The code doing that detection was changed
recently in 2.6.17 early stages but was done slightly incorrectly. It
should be testing for an exact match of "chrp" and it currently tests
for anything that begins with "chrp". That means it will incorrectly
match with platforms using Maple-like device-trees and have open
firmware. This fixes it by using strcmp instead of strncmp to match what
the actual platform detection code does.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

Paul, if you are happy with that, please send upsteam ASAP.

Index: linux-work/arch/powerpc/kernel/prom_init.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/prom_init.c	2006-05-02 10:51:33.000000000 +1000
+++ linux-work/arch/powerpc/kernel/prom_init.c	2006-05-15 15:37:03.000000000 +1000
@@ -1636,7 +1636,7 @@
 			   compat, sizeof(compat)-1);
 	if (len <= 0)
 		return PLATFORM_GENERIC;
-	if (strncmp(compat, RELOC("chrp"), 4))
+	if (strcmp(compat, RELOC("chrp")))
 		return PLATFORM_GENERIC;
 
 	/* Default to pSeries. We need to know if we are running LPAR */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-15 21:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-15  5:46 [PATCH] Fix pSeries identification in prom_init.c Benjamin Herrenschmidt
2006-05-15  5:51 ` Benjamin Herrenschmidt
2006-05-15 16:17   ` Michael Neuling
2006-05-15 21:08     ` Benjamin Herrenschmidt
2006-05-15  9:51 ` segher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).