linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Use arm_memblock_steal
@ 2012-04-03  8:17 Russell King - ARM Linux
  2012-04-03  8:56 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King - ARM Linux @ 2012-04-03  8:17 UTC (permalink / raw)
  To: linux-arm-kernel

Use the provided function rather than re-coding this bit of code.
This also gets us protection against using these functions from
invalid contexts.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
Please test this; I've not even compile tested this.  Thanks.

 arch/arm/mach-imx/mach-imx27_visstrim_m10.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index f7b074f..c27058e 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -32,12 +32,12 @@
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
 #include <linux/leds.h>
-#include <linux/memblock.h>
 #include <media/soc_camera.h>
 #include <sound/tlv320aic32x4.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
+#include <asm/memblock.h>
 #include <mach/common.h>
 #include <mach/iomux-mx27.h>
 
@@ -193,10 +193,8 @@ static void __init visstrim_camera_init(void)
 static void __init visstrim_reserve(void)
 {
 	/* reserve 4 MiB for mx2-camera */
-	mx2_camera_base = memblock_alloc(MX2_CAMERA_BUF_SIZE,
+	mx2_camera_base = arm_memblock_steal(MX2_CAMERA_BUF_SIZE,
 			MX2_CAMERA_BUF_SIZE);
-	memblock_free(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
-	memblock_remove(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
 }
 
 /* GPIOs used as events for applications */

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

* [PATCH] Use arm_memblock_steal
  2012-04-03  8:17 [PATCH] Use arm_memblock_steal Russell King - ARM Linux
@ 2012-04-03  8:56 ` Sascha Hauer
  2012-04-03  9:39   ` javier Martin
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2012-04-03  8:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 03, 2012 at 09:17:21AM +0100, Russell King - ARM Linux wrote:
> Use the provided function rather than re-coding this bit of code.
> This also gets us protection against using these functions from
> invalid contexts.
> 
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> Please test this; I've not even compile tested this.  Thanks.

It compiles, so from my pov:

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

However, I don't have the hardware to test it, so I hope Javier follows
up on this.

Sascha

> 
>  arch/arm/mach-imx/mach-imx27_visstrim_m10.c |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> index f7b074f..c27058e 100644
> --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> @@ -32,12 +32,12 @@
>  #include <linux/delay.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/leds.h>
> -#include <linux/memblock.h>
>  #include <media/soc_camera.h>
>  #include <sound/tlv320aic32x4.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
>  #include <asm/mach/time.h>
> +#include <asm/memblock.h>
>  #include <mach/common.h>
>  #include <mach/iomux-mx27.h>
>  
> @@ -193,10 +193,8 @@ static void __init visstrim_camera_init(void)
>  static void __init visstrim_reserve(void)
>  {
>  	/* reserve 4 MiB for mx2-camera */
> -	mx2_camera_base = memblock_alloc(MX2_CAMERA_BUF_SIZE,
> +	mx2_camera_base = arm_memblock_steal(MX2_CAMERA_BUF_SIZE,
>  			MX2_CAMERA_BUF_SIZE);
> -	memblock_free(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
> -	memblock_remove(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
>  }
>  
>  /* GPIOs used as events for applications */
> 
> 

-- 
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] Use arm_memblock_steal
  2012-04-03  8:56 ` Sascha Hauer
@ 2012-04-03  9:39   ` javier Martin
  0 siblings, 0 replies; 3+ messages in thread
From: javier Martin @ 2012-04-03  9:39 UTC (permalink / raw)
  To: linux-arm-kernel

On 3 April 2012 10:56, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Tue, Apr 03, 2012 at 09:17:21AM +0100, Russell King - ARM Linux wrote:
>> Use the provided function rather than re-coding this bit of code.
>> This also gets us protection against using these functions from
>> invalid contexts.
>>
>> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>> ---
>> Please test this; I've not even compile tested this. ?Thanks.
>
> It compiles, so from my pov:
>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
>
> However, I don't have the hardware to test it, so I hope Javier follows
> up on this.
>
> Sascha
>
>>
>> ?arch/arm/mach-imx/mach-imx27_visstrim_m10.c | ? ?6 ++----
>> ?1 files changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
>> index f7b074f..c27058e 100644
>> --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
>> +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
>> @@ -32,12 +32,12 @@
>> ?#include <linux/delay.h>
>> ?#include <linux/dma-mapping.h>
>> ?#include <linux/leds.h>
>> -#include <linux/memblock.h>
>> ?#include <media/soc_camera.h>
>> ?#include <sound/tlv320aic32x4.h>
>> ?#include <asm/mach-types.h>
>> ?#include <asm/mach/arch.h>
>> ?#include <asm/mach/time.h>
>> +#include <asm/memblock.h>
>> ?#include <mach/common.h>
>> ?#include <mach/iomux-mx27.h>
>>
>> @@ -193,10 +193,8 @@ static void __init visstrim_camera_init(void)
>> ?static void __init visstrim_reserve(void)
>> ?{
>> ? ? ? /* reserve 4 MiB for mx2-camera */
>> - ? ? mx2_camera_base = memblock_alloc(MX2_CAMERA_BUF_SIZE,
>> + ? ? mx2_camera_base = arm_memblock_steal(MX2_CAMERA_BUF_SIZE,
>> ? ? ? ? ? ? ? ? ? ? ? MX2_CAMERA_BUF_SIZE);
>> - ? ? memblock_free(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
>> - ? ? memblock_remove(mx2_camera_base, MX2_CAMERA_BUF_SIZE);
>> ?}
>>
>> ?/* GPIOs used as events for applications */
>>
>>
>
> --
> 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 |

Hi,
this patch works as expected in our Visstrim_SM10 board.

Tested-by: Javier Martin <javier.martin@vista-silicon.com>

Regards.

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

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

end of thread, other threads:[~2012-04-03  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-03  8:17 [PATCH] Use arm_memblock_steal Russell King - ARM Linux
2012-04-03  8:56 ` Sascha Hauer
2012-04-03  9:39   ` javier Martin

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