Re: [PATCH 1/3] arm: mm: allow boards to fiddle with meminfo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 10, 2010 at 10:03 PM, Russell King - ARM Linux
<linux@xxxxxxxxxxxxxxxx> wrote:
> On Sun, Oct 10, 2010 at 08:40:38PM +0300, Felipe Contreras wrote:
>> So that they can reserve some memory.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
>> ---
>> Âarch/arm/include/asm/mach/arch.h | Â Â2 +-
>> Âarch/arm/mm/init.c        |  Â7 ++++---
>> Â2 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
>> index 8a0dd18..408e4d5 100644
>> --- a/arch/arm/include/asm/mach/arch.h
>> +++ b/arch/arm/include/asm/mach/arch.h
>> @@ -38,7 +38,7 @@ struct machine_desc {
>>    void          Â(*fixup)(struct machine_desc *,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct tag *, char **,
>> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct meminfo *);
>> -   void          Â(*reserve)(void);/* reserve mem blocks Â*/
>> +   void          Â(*reserve)(struct meminfo *);/* reserve mem blocks   Â*/
>>    void          Â(*map_io)(void);/* IO mapping function Â*/
>>    void          Â(*init_irq)(void);
>>    struct sys_timer    Â*timer;     /* system tick timer  Â*/
>> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
>> index 7185b00..4b5c117 100644
>> --- a/arch/arm/mm/init.c
>> +++ b/arch/arm/mm/init.c
>> @@ -272,8 +272,6 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
>> Â Â Â int i;
>>
>> Â Â Â memblock_init();
>> - Â Â for (i = 0; i < mi->nr_banks; i++)
>> - Â Â Â Â Â Â memblock_add(mi->bank[i].start, mi->bank[i].size);
>>
>> Â Â Â /* Register the kernel text, kernel data and initrd with memblock. */
>> Â#ifdef CONFIG_XIP_KERNEL
>> @@ -295,7 +293,10 @@ void __init arm_memblock_init(struct meminfo *mi, struct machine_desc *mdesc)
>>
>> Â Â Â /* reserve any platform specific memblock areas */
>> Â Â Â if (mdesc->reserve)
>> - Â Â Â Â Â Â mdesc->reserve();
>> + Â Â Â Â Â Â mdesc->reserve(mi);
>> +
>> + Â Â for (i = 0; i < mi->nr_banks; i++)
>> + Â Â Â Â Â Â memblock_add(mi->bank[i].start, mi->bank[i].size);
>
> It is not a good idea to change the ordering here, as we'll now be
> adding the memory blocks _after_ we've started to make reservations
> into memblock.
>
> At least the omapfb code wants there to be memory present in memblock
> when ->reserve is called.

True. I initially added a new callback called reserve_mem(), but I
thought it would be nicer to avoid adding a new function almost
identical to an existing one.

Anyway, what is your suggestion? Can you come up with something else?

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux