[PATCH] powerpc: Fix assmption of end_of_DRAM() returns end address

Bhushan Bharat-R65777 R65777 at freescale.com
Wed Jun 6 10:46:17 EST 2012



> -----Original Message-----
> From: David Miller [mailto:davem at davemloft.net]
> Sent: Wednesday, June 06, 2012 3:51 AM
> To: benh at kernel.crashing.org
> Cc: Bhushan Bharat-R65777; linuxppc-dev at lists.ozlabs.org; linux-
> kernel at vger.kernel.org; galak at kernel.crashing.org; Bhushan Bharat-R65777
> Subject: Re: [PATCH] powerpc: Fix assmption of end_of_DRAM() returns end address
> 
> From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
> Date: Wed, 06 Jun 2012 08:17:39 +1000
> 
> > On Tue, 2012-06-05 at 19:25 +0530, Bharat Bhushan wrote:
> >> memblock_end_of_DRAM() returns end_address + 1, not end address.
> >> While some code assumes that it returns end address.
> >
> > Shouldn't we instead fix it the other way around ? IE, make
> > memblock_end_of_DRAM() does what the name implies, which is to return
> > the last byte of DRAM, and fix the -other- callers not to make bad
> > assumptions ?
> 
> That was my impression too when I saw this patch.

Initially I also intended to do so. I initiated a email on linux-mm@  subject "memblock_end_of_DRAM()  return end address + 1" and the only response I received from Andrea was:

"
It's normal that "end" means "first byte offset out of the range". End = not ok.
end = start+size.
This is true for vm_end too. So it's better to keep it that way.
My suggestion is to just fix point 1 below and audit the rest :)
"

Thanks
-Bharat



More information about the Linuxppc-dev mailing list