linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Hollis Blanchard" <hollis@penguinppc.org>
To: "Paul Mackerras" <paulus@samba.org>,
	"Ben Herrenschmidt" <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, Wolfgang Denk <wd@denx.de>,
	Milton Miller <miltonm@bga.com>, Ilya Yanok <yanok@emcraft.com>
Subject: Re: [PATCH] [v4] ppc: force memory size to be a multiple of PAGE_SIZE
Date: Mon, 1 Dec 2008 17:03:34 -0600	[thread overview]
Message-ID: <fb412d760812011503h7453d4dbt8e748c065ba364b6@mail.gmail.com> (raw)
In-Reply-To: <654d47bb9cbd63f515bf.1227716366@localhost.localdomain>

On Wed, Nov 26, 2008 at 10:19 AM, Hollis Blanchard <hollisb@us.ibm.com> wrote:
> 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>
> ---
> Changes from v3:
> - No need to call lmb_enforce_memory_limit() with limit=lmb_phys_mem_size().
>
> 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;
> +
>        DBG(" -> early_init_devtree(%p)\n", params);
>
>        /* Setup flat device-tree pointer */
> @@ -1200,7 +1202,19 @@ void __init early_init_devtree(void *par
>        early_reserve_mem();
>        phyp_dump_reserve_mem();
>
> -       lmb_enforce_memory_limit(memory_limit);
> +       limit = memory_limit;
> +       if (! limit) {
> +               unsigned long memsize;
> +
> +               /* 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);
> +
>        lmb_analyze();
>
>        DBG("Phys. mem: %lx\n", lmb_phys_mem_size());

Paul or Ben: since there have been no further comments on this, would
you queue it up for 2.6.29? Thanks.

-Hollis

      reply	other threads:[~2008-12-01 23:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26 16:19 [PATCH] [v4] ppc: force memory size to be a multiple of PAGE_SIZE Hollis Blanchard
2008-12-01 23:03 ` Hollis Blanchard [this message]

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=fb412d760812011503h7453d4dbt8e748c065ba364b6@mail.gmail.com \
    --to=hollis@penguinppc.org \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=miltonm@bga.com \
    --cc=paulus@samba.org \
    --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).