linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
Subject: Re: [Cbe-oss-dev] [PATCH] Ignore memory listed in PS3 device tree
Date: Fri, 30 Mar 2007 01:27:48 +0100	[thread overview]
Message-ID: <1175214468.3122.94.camel@pmac.infradead.org> (raw)
In-Reply-To: <1175210608.5624.42.camel@localhost.localdomain>

On Fri, 2007-03-30 at 09:23 +1000, Benjamin Herrenschmidt wrote:
> How can this work ? Memory is parsed from early_init_devtree() which is
> called before the platform probe() routines which is the one that sets
> FW_FEATURE_PS3_LV1...  

Ah, good point. I was only testing on a PS3-only kernel -- I hadn't yet
graduated to a multiplatform kernel, because there were other problems
there (check_legacy_ioport).

At your suggestion, how about this approach instead...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

--- linux-2.6.20.ppc64/include/asm-powerpc/lmb.h~	2007-02-04 18:44:54.000000000 +0000
+++ linux-2.6.20.ppc64/include/asm-powerpc/lmb.h	2007-03-30 01:13:45.000000000 +0100
@@ -51,6 +51,7 @@ extern unsigned long __init __lmb_alloc_
 extern unsigned long __init lmb_phys_mem_size(void);
 extern unsigned long __init lmb_end_of_DRAM(void);
 extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
+void __init lmb_reset_available(void);
 
 extern void lmb_dump_all(void);
 
--- linux-2.6.20.ppc64/arch/powerpc/mm/lmb.c~	2007-02-04 18:44:54.000000000 +0000
+++ linux-2.6.20.ppc64/arch/powerpc/mm/lmb.c	2007-03-30 01:12:17.000000000 +0100
@@ -338,3 +338,11 @@ void __init lmb_enforce_memory_limit(uns
 		}
 	}
 }
+
+void __init lmb_reset_available(void)
+{
+	lmb.memory.region[0].base = 0;
+	lmb.memory.region[0].size = 0;
+	lmb.memory.cnt = 1;
+	lmb.memory.size = 0;
+}
--- linux-2.6.20.ppc64/arch/powerpc/platforms/ps3/mm.c~	2007-03-29 17:48:27.000000000 +0100
+++ linux-2.6.20.ppc64/arch/powerpc/platforms/ps3/mm.c	2007-03-30 01:24:04.000000000 +0100
@@ -796,6 +796,9 @@ void __init ps3_mm_init(void)
 
 	DBG(" -> %s:%d\n", __func__, __LINE__);
 
+	/* If an old-style device-tree registered memory, forget it */
+	lmb_reset_available();
+
 	result = ps3_repository_read_mm_info(&map.rm.base, &map.rm.size,
 		&map.total);
 

-- 
dwmw2

  reply	other threads:[~2007-03-30  0:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-29 22:43 [PATCH] Ignore memory listed in PS3 device tree David Woodhouse
2007-03-29 23:23 ` [Cbe-oss-dev] " Benjamin Herrenschmidt
2007-03-30  0:27   ` David Woodhouse [this message]
2007-03-30 13:25 ` Segher Boessenkool
2007-04-02  0:20   ` Michael Ellerman
2007-04-02 17:36     ` Segher Boessenkool
2007-04-03  2:42       ` Michael Ellerman
2007-04-03  3:16         ` David Woodhouse
2007-04-03 14:45           ` David Woodhouse
2007-04-03 21:18             ` Geoff Levand
2007-04-03 21:48               ` David Woodhouse
2007-04-03 22:45                 ` Geoff Levand
2007-04-03 22:55                   ` Arnd Bergmann
2007-04-03 23:58                     ` Geoff Levand
2007-04-04  0:10                       ` David Woodhouse
2007-04-04 11:43                       ` Segher Boessenkool
2007-04-04  1:30                   ` Benjamin Herrenschmidt
2007-04-04  1:28               ` Benjamin Herrenschmidt
2007-04-04  1:26             ` Benjamin Herrenschmidt
2007-03-30 17:41 ` Geoff Levand
2007-03-30 17:45   ` David Woodhouse
2007-03-30 18:11     ` Segher Boessenkool
2007-03-30 18:13       ` David Woodhouse
2007-03-31 15:27         ` Segher Boessenkool
2007-03-31 22:34           ` Benjamin Herrenschmidt
2007-03-31 22:42             ` David Woodhouse
2007-04-06 21:22 ` Geoff Levand
2007-04-06 22:34   ` Benjamin Herrenschmidt
2007-04-06 22:43     ` David Woodhouse
2007-04-06 23:15       ` Geoff Levand
2007-04-06 23:35       ` Benjamin Herrenschmidt
2007-04-06 23:44         ` David Woodhouse

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=1175214468.3122.94.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=benh@kernel.crashing.org \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).