Re: [PATCH] arm: Handle device tree memory regions larger than 4GB

2012-07-07 Thread Peter Maydell
On 6 July 2012 20:26, Dave Martin  wrote:
> On Fri, Jul 06, 2012 at 07:07:35PM +0100, Peter Maydell wrote:
>> On 6 July 2012 00:27, Rob Herring  wrote:
>> > I would just change arm_add_memory to use phys_addr_t for the size
>> > param. This ultimately calls memblock functions which use phys_addr_t
>> > for sizes.
>>
>> So I have a patch that does this which basically works. However
>> there is a bit I'm not sure about. arm_add_memory() does this:
>>bank->size = size & PAGE_MASK;
>>
>> in an attempt to clear the bottom bits of the size. However,
>> since PAGE_MASK is defined as:
>>  #define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)
>>  #define PAGE_MASK   (~(PAGE_SIZE-1))
>>
>> PAGE_MASK is a 32 bit unsigned constant and so this & will
>> clear the top 32 bits of bank->size.
>>
>> I'm really not sure what the best way to fix this is; suggestions?
>
> Maybe something like
>
> ~(phys_addr_t)~PAGE_MASK
>
> or
>
> ~(phys_addr_t)(PAGE_SIZE - 1)
>
> would work.

Mmm. It feels a bit unsatisfactory that an "obviously correct"
line of code like "size &= ~PAGE_MASK" could actually be subtly
wrong (seems like the kind of thing that could easily slip
through code review), so I was wondering if maybe redefining
PAGE_MASK so it didn't do the wrong thing on 64 bit types
would be better. (That's definitely way out of my depth though.)

-- PMM

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: [PATCH] arm: Handle device tree memory regions larger than 4GB

2012-07-07 Thread Rob Herring
On 07/07/2012 05:36 AM, Peter Maydell wrote:
> On 6 July 2012 20:26, Dave Martin  wrote:
>> On Fri, Jul 06, 2012 at 07:07:35PM +0100, Peter Maydell wrote:
>>> On 6 July 2012 00:27, Rob Herring  wrote:
 I would just change arm_add_memory to use phys_addr_t for the size
 param. This ultimately calls memblock functions which use phys_addr_t
 for sizes.
>>>
>>> So I have a patch that does this which basically works. However
>>> there is a bit I'm not sure about. arm_add_memory() does this:
>>>bank->size = size & PAGE_MASK;
>>>
>>> in an attempt to clear the bottom bits of the size. However,
>>> since PAGE_MASK is defined as:
>>>  #define PAGE_SIZE   (_AC(1,UL) << PAGE_SHIFT)
>>>  #define PAGE_MASK   (~(PAGE_SIZE-1))
>>>
>>> PAGE_MASK is a 32 bit unsigned constant and so this & will
>>> clear the top 32 bits of bank->size.
>>>
>>> I'm really not sure what the best way to fix this is; suggestions?
>>
>> Maybe something like
>>
>> ~(phys_addr_t)~PAGE_MASK
>>
>> or
>>
>> ~(phys_addr_t)(PAGE_SIZE - 1)
>>
>> would work.
> 
> Mmm. It feels a bit unsatisfactory that an "obviously correct"
> line of code like "size &= ~PAGE_MASK" could actually be subtly
> wrong (seems like the kind of thing that could easily slip
> through code review), so I was wondering if maybe redefining
> PAGE_MASK so it didn't do the wrong thing on 64 bit types
> would be better. (That's definitely way out of my depth though.)
> 

While there is a mixture of usage of PAGE_MASK in the kernel, I think
correct usage is with virt addresses. For phys addresses, there is
PHYS_MASK which is sized correctly for LPAE.

You really should post this on the lakml list.

Rob

> -- PMM
> 



___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Nexus 7/Jellybean Kernel Config

2012-07-07 Thread Christian Robottom Reis
On Wed, Jul 04, 2012 at 10:31:30PM +0200, Marcin Juszkiewicz wrote:
> W dniu 04.07.2012 22:19, Christian Robottom Reis pisze:
> > Hey there,
> > 
> > I stumbled onto a thread on xdadevelopers where they are looking at
> > the Nexus 7; apart from partition and df output, there's a 3.1.10 kernel
> > config, which I'm attaching here for convenience and analysis.
> > 
> > ls -l /dev/block/platform/sdhci-tegra.3/by-name/
> ..
> > lrwxrwxrwx root root 2012-06-28 11:51 MDA -> /dev/block/mmcblk0p8
> > lrwxrwxrwx root root 2012-06-28 11:51 UDA -> /dev/block/mmcblk0p9
> 
> Patched kernel to have 9 partitions on mmc...

Why is this not upstream?
-- 
Christian Robottom Reis, Engineering VP
Brazil (GMT-3) | [+55] 16 9112 6430 | [+1] 612 216 4935
Linaro.org: Open Source Software for ARM SoCs

___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev


Re: Nexus 7/Jellybean Kernel Config

2012-07-07 Thread Paul Larson
Shouldn't require a kernel change. Just a configuration with a really
annoyingly low default. I am concerned with the explosion of the numbers
mmc partitions in android though...
On Jul 7, 2012 12:09 PM, "Christian Robottom Reis"  wrote:

> On Wed, Jul 04, 2012 at 10:31:30PM +0200, Marcin Juszkiewicz wrote:
> > W dniu 04.07.2012 22:19, Christian Robottom Reis pisze:
> > > Hey there,
> > >
> > > I stumbled onto a thread on xdadevelopers where they are looking at
> > > the Nexus 7; apart from partition and df output, there's a 3.1.10
> kernel
> > > config, which I'm attaching here for convenience and analysis.
> > >
> > > ls -l /dev/block/platform/sdhci-tegra.3/by-name/
> > ..
> > > lrwxrwxrwx root root 2012-06-28 11:51 MDA -> /dev/block/mmcblk0p8
> > > lrwxrwxrwx root root 2012-06-28 11:51 UDA -> /dev/block/mmcblk0p9
> >
> > Patched kernel to have 9 partitions on mmc...
>
> Why is this not upstream?
> --
> Christian Robottom Reis, Engineering VP
> Brazil (GMT-3) | [+55] 16 9112 6430 | [+1] 612 216 4935
> Linaro.org: Open Source Software for ARM SoCs
>
> ___
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>
___
linaro-dev mailing list
linaro-dev@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/linaro-dev