linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Hollis Blanchard <hollisb@us.ibm.com>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: Wolfgang Denk <wd@denx.de>, Ilya Yanok <yanok@emcraft.com>,
	Milton Miller <miltonm@bga.com>,
	linux-ppc <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] [v3] powerpc/4xx: work around CHIP11 errata in a more PAGE_SIZE-friendly way
Date: Mon, 24 Nov 2008 14:07:15 -0600	[thread overview]
Message-ID: <1227557235.17746.25.camel@localhost.localdomain> (raw)
In-Reply-To: <200811141609.44161.hollisb@us.ibm.com>

On Fri, 2008-11-14 at 16:09 -0600, Hollis Blanchard wrote:
> 
> If this is all too much, then I'm close to giving up and burning a
> 64KB page, which requires only ALIGN_DOWN() in the kernel.

ppc: force memory size to be a multiple of PAGE_SIZE

Ensure that total memory size is page-aligned, because otherwise
bootmem.c gets upset.

This error case was triggered by using 64 KiB pages in the kernel while
arch/powerpc/boot/4xx.c arbitrarily reduced the amount of memory by 4096 (to
work around the "CHIP11" errata which affects the last 256 bytes of physical memory).

Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
---
This is on a common code path, and lmb_enforce_memory_limit() will now
always take action, so wider testing would be good.

This patch supercedes http://patchwork.ozlabs.org/patch/8211/ .

diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1200,6 +1200,11 @@ void __init early_init_devtree(void *par
 	early_reserve_mem();
 	phyp_dump_reserve_mem();
 
+	/* Ensure that total memory size is page-aligned, because otherwise
+	 * bootmem.c gets upset. */
+	lmb_analyze();
+	memory_limit = lmb_phys_mem_size() & PAGE_MASK;
+
 	lmb_enforce_memory_limit(memory_limit);
 	lmb_analyze();
 
-- 
Hollis Blanchard
IBM Linux Technology Center

  parent reply	other threads:[~2008-11-24 20:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-14 17:25 [PATCH] [v3] powerpc/4xx: work around CHIP11 errata in a more PAGE_SIZE-friendly way Milton Miller
2008-11-14 17:29 ` Milton Miller
2008-11-14 22:09   ` Hollis Blanchard
2008-11-18 20:33     ` Hollis Blanchard
2008-11-24 20:07     ` Hollis Blanchard [this message]
2008-11-25  0:10       ` Michael Ellerman
2008-11-25 17:10         ` Milton Miller
2008-11-25 21:17           ` Hollis Blanchard
2008-11-25 21:53         ` Hollis Blanchard
2008-11-25 23:43           ` Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2008-11-12  0:06 Hollis Blanchard
2008-11-12  0:09 ` David Gibson
2008-11-12  4:37 ` Benjamin Herrenschmidt
2008-11-12 11:31   ` Josh Boyer
2008-11-12 11:52     ` Benjamin Herrenschmidt
2008-11-12 15:11       ` Hollis Blanchard
2008-11-12 20:44         ` Benjamin Herrenschmidt
2008-11-12 20:53           ` Josh Boyer
2008-11-13 19:54           ` Hollis Blanchard

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=1227557235.17746.25.camel@localhost.localdomain \
    --to=hollisb@us.ibm.com \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=wd@denx.de \
    --cc=yanok@emcraft.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;
as well as URLs for NNTP newsgroup(s).