linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow memblock steal operations to remove memory from anywhere
@ 2012-08-12 10:57 Russell King - ARM Linux
  2012-08-12 12:07 ` Sascha Hauer
  2012-08-12 12:46 ` Shilimkar, Santosh
  0 siblings, 2 replies; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-08-12 10:57 UTC (permalink / raw)
  To: linux-arm-kernel

Found this with the cubox, which wants to obtain large blocks of
RAM for the GPU and VPU devices at boot time.  I don't believe
any other platforms care where the memory comes from, so I think
this is safe.

However, OMAP and iMX folk should check this patch - thanks.

8<===
From: Russell King <rmk+kernel@arm.linux.org.uk>
Subject: ARM: Allow arm_memblock_steal() to remove memory from any RAM region

Allow arm_memblock_steal() to remove memory from any RAM region,
including highmem areas.  This allows memory to be stolen from the
very top of declared memory, including highmem areas, rather than
our precious lowmem.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mm/init.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f54d592..04632f3 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -324,7 +324,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
 
 	BUG_ON(!arm_memblock_steal_permitted);
 
-	phys = memblock_alloc(size, align);
+	phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);
 	memblock_free(phys, size);
 	memblock_remove(phys, size);
 

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

* [PATCH] Allow memblock steal operations to remove memory from anywhere
  2012-08-12 10:57 [PATCH] Allow memblock steal operations to remove memory from anywhere Russell King - ARM Linux
@ 2012-08-12 12:07 ` Sascha Hauer
  2012-08-12 12:46 ` Shilimkar, Santosh
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-08-12 12:07 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Aug 12, 2012 at 11:57:08AM +0100, Russell King - ARM Linux wrote:
> Found this with the cubox, which wants to obtain large blocks of
> RAM for the GPU and VPU devices at boot time.  I don't believe
> any other platforms care where the memory comes from, so I think
> this is safe.
> 
> However, OMAP and iMX folk should check this patch - thanks.
> 
> 8<===
> From: Russell King <rmk+kernel@arm.linux.org.uk>
> Subject: ARM: Allow arm_memblock_steal() to remove memory from any RAM region
> 
> Allow arm_memblock_steal() to remove memory from any RAM region,
> including highmem areas.  This allows memory to be stolen from the
> very top of declared memory, including highmem areas, rather than
> our precious lowmem.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

There shouldn't be any problems with this on i.MX.

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>


> ---
>  arch/arm/mm/init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index f54d592..04632f3 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -324,7 +324,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
>  
>  	BUG_ON(!arm_memblock_steal_permitted);
>  
> -	phys = memblock_alloc(size, align);
> +	phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);
>  	memblock_free(phys, size);
>  	memblock_remove(phys, size);
>  
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

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

* [PATCH] Allow memblock steal operations to remove memory from anywhere
  2012-08-12 10:57 [PATCH] Allow memblock steal operations to remove memory from anywhere Russell King - ARM Linux
  2012-08-12 12:07 ` Sascha Hauer
@ 2012-08-12 12:46 ` Shilimkar, Santosh
  1 sibling, 0 replies; 3+ messages in thread
From: Shilimkar, Santosh @ 2012-08-12 12:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, Aug 12, 2012 at 4:27 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> Found this with the cubox, which wants to obtain large blocks of
> RAM for the GPU and VPU devices at boot time.  I don't believe
> any other platforms care where the memory comes from, so I think
> this is safe.
>
Agree.

> However, OMAP and iMX folk should check this patch - thanks.
>
Works for OMAP without any issues.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>

> 8<===
> From: Russell King <rmk+kernel@arm.linux.org.uk>
> Subject: ARM: Allow arm_memblock_steal() to remove memory from any RAM region
>
> Allow arm_memblock_steal() to remove memory from any RAM region,
> including highmem areas.  This allows memory to be stolen from the
> very top of declared memory, including highmem areas, rather than
> our precious lowmem.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
>  arch/arm/mm/init.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
> index f54d592..04632f3 100644
> --- a/arch/arm/mm/init.c
> +++ b/arch/arm/mm/init.c
> @@ -324,7 +324,7 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
>
>         BUG_ON(!arm_memblock_steal_permitted);
>
> -       phys = memblock_alloc(size, align);
> +       phys = memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ANYWHERE);
>         memblock_free(phys, size);
>         memblock_remove(phys, size);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-08-12 12:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-12 10:57 [PATCH] Allow memblock steal operations to remove memory from anywhere Russell King - ARM Linux
2012-08-12 12:07 ` Sascha Hauer
2012-08-12 12:46 ` Shilimkar, Santosh

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