linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] micro optimise pSeries_probe
@ 2006-12-08  7:08 Anton Blanchard
  2006-12-08  7:22 ` [PATCH] dont allow pSeries_probe to succeed without initialising MMU Anton Blanchard
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2006-12-08  7:08 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


We find the OF root the line before, we may as well use it.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: kernel/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- kernel.orig/arch/powerpc/platforms/pseries/setup.c	2006-10-24 10:23:28.234782030 -0500
+++ kernel/arch/powerpc/platforms/pseries/setup.c	2006-10-24 10:26:19.068732015 -0500
@@ -503,8 +503,8 @@ static int __init pSeries_probe_hypertas
 static int __init pSeries_probe(void)
 {
 	unsigned long root = of_get_flat_dt_root();
- 	char *dtype = of_get_flat_dt_prop(of_get_flat_dt_root(),
- 					  "device_type", NULL);
+ 	char *dtype = of_get_flat_dt_prop(root, "device_type", NULL);
+
  	if (dtype == NULL)
  		return 0;
  	if (strcmp(dtype, "chrp"))

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

* [PATCH] dont allow pSeries_probe to succeed without initialising MMU
  2006-12-08  7:08 [PATCH] micro optimise pSeries_probe Anton Blanchard
@ 2006-12-08  7:22 ` Anton Blanchard
  2006-12-09  5:47   ` Stephen Rothwell
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Blanchard @ 2006-12-08  7:22 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: paulus


pSeries_probe can decide that we are a pseries but then fail to
initialise the MMU. If an rtas node doesnt exist, we continually fall
out of pSeries_probe_hypertas early and never get to the MMU init code.

While pseries without RTAS is an illegal combination, the way we
currently fail is a pain to track down, and can happen if your flattened
device tree code has issues (like mine did :).

With the following patch we init the MMU, come up and print some
warnings about RTAS not existing, instead of looping on 0x400 exceptions.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

Index: kernel/arch/powerpc/platforms/pseries/setup.c
===================================================================
--- kernel.orig/arch/powerpc/platforms/pseries/setup.c	2006-10-24 10:26:59.494464648 -0500
+++ kernel/arch/powerpc/platforms/pseries/setup.c	2006-10-24 10:27:39.714227044 -0500
@@ -492,11 +492,6 @@ static int __init pSeries_probe_hypertas
 	if (of_get_flat_dt_prop(node, "ibm,hypertas-functions", NULL) != NULL)
  		powerpc_firmware_features |= FW_FEATURE_LPAR;
 
-	if (firmware_has_feature(FW_FEATURE_LPAR))
-		hpte_init_lpar();
-	else
-		hpte_init_native();
-
  	return 1;
 }
 
@@ -522,6 +517,11 @@ static int __init pSeries_probe(void)
 	/* Now try to figure out if we are running on LPAR */
 	of_scan_flat_dt(pSeries_probe_hypertas, NULL);
 
+	if (firmware_has_feature(FW_FEATURE_LPAR))
+		hpte_init_lpar();
+	else
+		hpte_init_native();
+
 	DBG("Machine is%s LPAR !\n",
 	    (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
 

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

* Re: [PATCH] dont allow pSeries_probe to succeed without initialising MMU
  2006-12-08  7:22 ` [PATCH] dont allow pSeries_probe to succeed without initialising MMU Anton Blanchard
@ 2006-12-09  5:47   ` Stephen Rothwell
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2006-12-09  5:47 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: linuxppc-dev, paulus

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

On Fri, 8 Dec 2006 18:22:09 +1100 Anton Blanchard <anton@samba.org> wrote:
>
>  	DBG("Machine is%s LPAR !\n",
>  	    (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Want to change that to firmware_has_feature(FW_FEATURE_LPAR) while you
are there?

--
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2006-12-09  5:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08  7:08 [PATCH] micro optimise pSeries_probe Anton Blanchard
2006-12-08  7:22 ` [PATCH] dont allow pSeries_probe to succeed without initialising MMU Anton Blanchard
2006-12-09  5:47   ` Stephen Rothwell

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).