Subject: [PATCHv2 2/2] arm64: Enable CMA

From: [email-masked] (Laura Abbott)
Date: Tue, 10 Dec 2013 13:06:39 -0800

On 12/10/2013 11:52 AM, Laura Abbott wrote:

>
> @@ -36,14 +37,33 @@ static void *arm64_swiotlb_alloc_coherent(struct device *dev, size_t size,
>   	if (dev && IS_ENABLED(CONFIG_ZONE_DMA32) &&
>   	    dev->coherent_dma_mask <= DMA_BIT_MASK(32))
>   		flags |= GFP_DMA32;
> -	return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
> +	if (IS_ENABLED(CONFIG_DMA_CMA)) {
> +		struct page *page;
> +
> +		page = dma_alloc_from_contiguous(dev, size >> PAGE_SHIFT,
> +							get_order(size));
> +		if (!page)
> +			return NULL;
> +
> +		return page_address(page);
> +	} else {
> +		return swiotlb_alloc_coherent(dev, size, dma_handle, flags);
> +	}
>   }

Whoops I manged to send out the incorrect version here where I never set 
the dma_handle. Let me resend again...

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation