linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: felipe.contreras@gmail.com (Felipe Contreras)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] arm: mm: allow boards to fiddle with meminfo
Date: Sun, 10 Oct 2010 22:37:51 +0300	[thread overview]
Message-ID: <AANLkTikoub1K3HOP=bs0moCk1vYD8gPEu7DCvrUnMATi@mail.gmail.com> (raw)
In-Reply-To: <20101010190308.GA15906@n2100.arm.linux.org.uk>

On Sun, Oct 10, 2010 at 10:03 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> 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@gmail.com>
>> ---
>> ?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

  reply	other threads:[~2010-10-10 19:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-10 17:40 [PATCH 0/3] staging: tidspbridge: fix ioremap() usage Felipe Contreras
2010-10-10 17:40 ` [PATCH 1/3] arm: mm: allow boards to fiddle with meminfo Felipe Contreras
2010-10-10 19:03   ` Russell King - ARM Linux
2010-10-10 19:37     ` Felipe Contreras [this message]
2010-10-10 17:40 ` [PATCH 2/3] omap: dsp: fix ioremap() usage Felipe Contreras
2010-10-10 20:17   ` Premi, Sanjeev
2010-10-10 20:39     ` Felipe Contreras
2010-10-11 15:15   ` Guzman Lugo, Fernando
2010-10-11 19:05     ` Felipe Contreras
2010-10-10 17:40 ` [PATCH 3/3] staging: tidspbridge: remove memory consistency from TODO list Felipe Contreras
2010-10-11 10:40   ` Arnd Bergmann
2010-10-11 11:16     ` Felipe Contreras
2010-10-11 14:02       ` Arnd Bergmann

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='AANLkTikoub1K3HOP=bs0moCk1vYD8gPEu7DCvrUnMATi@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).