LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
@ 2008-02-19 19:51 Kumar Gala
  2008-02-20  0:30 ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2008-02-19 19:51 UTC (permalink / raw)
  To: davem; +Cc: linuxppc-dev, linux-kernel, sparclinux

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
  2008-02-19 19:51 [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base Kumar Gala
@ 2008-02-20  0:30 ` David Miller
  2008-02-20  3:02   ` Kumar Gala
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2008-02-20  0:30 UTC (permalink / raw)
  To: galak; +Cc: linuxppc-dev, linux-kernel, sparclinux

From: Kumar Gala <galak@kernel.crashing.org>
Date: Tue, 19 Feb 2008 13:51:37 -0600 (CST)

> 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.

I think my tree has already or will soon be pulled in so
I don't want to rebase it.

Why don't you simply send me the relative bug fix instead?

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
  2008-02-20  0:30 ` David Miller
@ 2008-02-20  3:02   ` Kumar Gala
  2008-02-20  3:31     ` David Miller
  2008-02-21  2:15     ` Paul Mackerras
  0 siblings, 2 replies; 7+ messages in thread
From: Kumar Gala @ 2008-02-20  3:02 UTC (permalink / raw)
  To: David Miller; +Cc: linuxppc-dev, linux-kernel, sparclinux


On Feb 19, 2008, at 6:30 PM, David Miller wrote:

> From: Kumar Gala <galak@kernel.crashing.org>
> Date: Tue, 19 Feb 2008 13:51:37 -0600 (CST)
>
>> 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.
>
> I think my tree has already or will soon be pulled in so
> I don't want to rebase it.
>
> Why don't you simply send me the relative bug fix instead?

np.  Are we trying to get this into 2.6.25 or .26?

- k

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
  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
  1 sibling, 1 reply; 7+ messages in thread
From: David Miller @ 2008-02-20  3:31 UTC (permalink / raw)
  To: galak; +Cc: sparclinux, linuxppc-dev, linux-kernel

From: Kumar Gala <galak@kernel.crashing.org>
Date: Tue, 19 Feb 2008 21:02:04 -0600

> np.  Are we trying to get this into 2.6.25 or .26?

I'm ambivalent but I would obviously prefer 2.6.25 because
it would allow me to proceed more easily with my sparc64
NUMA work as well as get your bug fixes in more smoothly.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
  2008-02-20  3:02   ` Kumar Gala
  2008-02-20  3:31     ` David Miller
@ 2008-02-21  2:15     ` Paul Mackerras
  2008-02-21  4:01       ` Josh Boyer
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Mackerras @ 2008-02-21  2:15 UTC (permalink / raw)
  To: Kumar Gala; +Cc: David Miller, sparclinux, linuxppc-dev, linux-kernel

Kumar Gala writes:

> np.  Are we trying to get this into 2.6.25 or .26?

I was going to put it into my powerpc-next branch and put it in
2.6.26.  I don't see any need for it to go in 2.6.25.

Paul.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
  2008-02-20  3:31     ` David Miller
@ 2008-02-21  2:16       ` Paul Mackerras
  0 siblings, 0 replies; 7+ messages in thread
From: Paul Mackerras @ 2008-02-21  2:16 UTC (permalink / raw)
  To: David Miller; +Cc: galak, sparclinux, linuxppc-dev, linux-kernel

David Miller writes:

> I'm ambivalent but I would obviously prefer 2.6.25 because
> it would allow me to proceed more easily with my sparc64
> NUMA work as well as get your bug fixes in more smoothly.

Sounds like we should get Stephen to put it in linux-next-stable once
we're convinced it's all OK.

Paul.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base
  2008-02-21  2:15     ` Paul Mackerras
@ 2008-02-21  4:01       ` Josh Boyer
  0 siblings, 0 replies; 7+ messages in thread
From: Josh Boyer @ 2008-02-21  4:01 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Kumar Gala, sparclinux, linuxppc-dev, David Miller, linux-kernel

On Thu, 21 Feb 2008 13:15:58 +1100
Paul Mackerras <paulus@samba.org> wrote:

> Kumar Gala writes:
> 
> > np.  Are we trying to get this into 2.6.25 or .26?
> 
> I was going to put it into my powerpc-next branch and put it in
> 2.6.26.  I don't see any need for it to go in 2.6.25.

Is that a new branch you're going to create, or the normal "for-2.6.xx"?

josh

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-02-21  4:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-19 19:51 [PATCH v2][POWERPC] Fix initial lmb add region with a non-zero base Kumar Gala
2008-02-20  0:30 ` 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

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).