[PATCH 1/3] TILER: Move dma_alloc_coherent call to tiler init

Bryan Wu bryan.wu at canonical.com
Tue Jul 13 03:34:09 UTC 2010


On 07/13/2010 11:22 AM, Bryan Wu wrote:
> From: David Sin <davidsin at ti.com>
> 
> Instead of allocating and freeing PAT page array
> memory each time, allocate 128k upfront and reuse the
> memory.  This will avoid the possibilty of not being
> able to obtain the memory after driver initialization.
> 
> Signed-off-by: David Sin <davidsin at ti.com>
> ---
>  drivers/media/video/tiler/tiler.c |   27 +++++++++++++++------------
>  1 files changed, 15 insertions(+), 12 deletions(-)
> 

[snip]

>  
> +	/* Array of physical pages for PAT programming, which must be a 16-byte
> +	   aligned physical address
> +	*/
> +	dmac_va = dma_alloc_coherent(NULL, TILER_WIDTH * TILER_HEIGHT *
> +					sizeof(*dmac_va), &dmac_pa, GFP_ATOMIC);
> +	if (!dmac_va)
> +		return -ENOMEM;
> +

Returning -ENOMEM is not enough here. IMHO, at least it should deinit
sita_init(). Or just follow the error exit path.

Thanks,
-Bryan




More information about the kernel-team mailing list