[PATCH] [v3] powerpc/4xx: work around CHIP11 errata in a more PAGE_SIZE-friendly way

Michael Ellerman michael at ellerman.id.au
Tue Nov 25 11:10:28 EST 2008


On Mon, 2008-11-24 at 14:07 -0600, Hollis Blanchard wrote:
> 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 at 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;

All of the current code using memory_limit looks like it'll be safe with
this change, although there are several cases of this we could remove:

if (memory_limit && <some other condition>)

Because memory_limit will now always be true.

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.

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20081125/03ce064e/attachment.pgp>


More information about the Linuxppc-dev mailing list