From: Kumar Gala <galak@kernel.crashing.org>
To: davem@davemloft.net
Cc: sparclinux@vger.kernel.org, linuxppc-dev@ozlabs.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
Date: Tue, 19 Feb 2008 13:51:37 -0600 (CST) [thread overview]
Message-ID: <Pine.LNX.4.64.0802191350590.10089@blarg.am.freescale.net> (raw)
If we add to an empty lmb region with a non-zero base we will not coalesce
the number of regions down to one. This causes problems on ppc32 for the
memory region as its assumed to only have one region.
We can fix this easily by causing the initial add to replace the dummy
region.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
Fix a bug the initial patch introduced if we have a region that gets added
at the beginning of the list we wouldn't actually add it.
Dave can you replace the patch in you tree with this one.
arch/powerpc/mm/lmb.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/mm/lmb.c b/arch/powerpc/mm/lmb.c
index 4ce23bc..4bf8f19 100644
--- a/arch/powerpc/mm/lmb.c
+++ b/arch/powerpc/mm/lmb.c
@@ -141,6 +141,12 @@ static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
unsigned long coalesced = 0;
long adjacent, i;
+ if ((rgn->cnt == 1) && (rgn->region[0].size == 0)) {
+ rgn->region[0].base = base;
+ rgn->region[0].size = size;
+ return 0;
+ }
+
/* First try and coalesce this LMB with another. */
for (i=0; i < rgn->cnt; i++) {
unsigned long rgnbase = rgn->region[i].base;
@@ -185,6 +191,12 @@ static long __init lmb_add_region(struct lmb_region *rgn, unsigned long base,
break;
}
}
+
+ if (base < rgn->region[0].base) {
+ rgn->region[0].base = base;
+ rgn->region[0].size = size;
+ }
+
rgn->cnt++;
return 0;
--
1.5.3.8
next reply other threads:[~2008-02-19 19:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-19 19:51 Kumar Gala [this message]
2008-02-20 0:30 ` [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base David Miller
2008-02-20 3:02 ` Kumar Gala
2008-02-20 3:31 ` David Miller
2008-02-21 2:16 ` Paul Mackerras
2008-02-21 2:15 ` Paul Mackerras
2008-02-21 4:01 ` Josh Boyer
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=Pine.LNX.4.64.0802191350590.10089@blarg.am.freescale.net \
--to=galak@kernel.crashing.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=sparclinux@vger.kernel.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).