All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Hollis Blanchard <hollisb@us.ibm.com>
Cc: Milton Miller <miltonm@bga.com>, Wolfgang Denk <wd@denx.de>,
	Ilya Yanok <yanok@emcraft.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: Wed, 26 Nov 2008 10:43:51 +1100	[thread overview]
Message-ID: <1227656631.8016.4.camel@localhost> (raw)
In-Reply-To: <1227650039.7434.33.camel@localhost.localdomain>

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

On Tue, 2008-11-25 at 15:53 -0600, Hollis Blanchard wrote:
> On Tue, 2008-11-25 at 11:10 +1100, Michael Ellerman wrote:
> > 
> > Still, I think it would be better to only set memory_limit when the mem
> > size is not a multiple of the PAGE_SIZE - so that memory_limit retains
> > it's function as both the value of the limit and a boolean.
> 
> OK, how's this?
> 
> ppc: force memory size to be a multiple of PAGE_SIZE
> 
> Ensure that total memory size is page-aligned, because otherwise
> mark_bootmem() 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 a chip bug that affects the last 256 bytes of physical memory).
> 
> Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
> 
> 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
> @@ -1160,6 +1160,8 @@ static inline void __init phyp_dump_rese
>  
>  void __init early_init_devtree(void *params)
>  {
> +	unsigned long limit, memsize;
> +
>  	DBG(" -> early_init_devtree(%p)\n", params);
>  
>  	/* Setup flat device-tree pointer */
> @@ -1200,7 +1202,15 @@ void __init early_init_devtree(void *par
>  	early_reserve_mem();
>  	phyp_dump_reserve_mem();

I was thinking more like the following:

>  
> -	lmb_enforce_memory_limit(memory_limit);
> +	limit = memory_limit;
> +	if (! limit) {
> +		/* Ensure that total memory size is page-aligned, because
> +		 * otherwise mark_bootmem() gets upset. */
> +		lmb_analyze();
                  memsize = lmb_phys_mem_size();
		  if(memsize & PAGE_MASK != memsize)
		        limit = memsize & PAGE_MASK;
> +	}
> +	lmb_enforce_memory_limit(limit);
> +

So that we never needlessly run through the enforce code with limit =
memsize. But maybe it's a bit pedantic.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-11-25 23:43 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
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 [this message]
  -- 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=1227656631.8016.4.camel@localhost \
    --to=michael@ellerman.id.au \
    --cc=hollisb@us.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.