Re: [RFC PATCH] arm: dma-mapping: fallback allocation for cma failure

From: Gioh Kim
Date: Tue May 20 2014 - 19:40:03 EST




2014-05-20 ìí 5:32, Joonsoo Kim ì ê:
On Tue, May 20, 2014 at 04:05:52PM +0900, Gioh Kim wrote:
That case, device-specific coherent memory allocation, is handled at dma_alloc_coherent in arm_dma_alloc.
__dma_alloc handles only general coherent memory allocation.

I'm sorry missing mention about it.


Hello,

AFAIK, *coherent* memory allocation is different with *contiguous* memory
allocation(CMA). So we need to handle the case I mentioned.

Yes, I confused the coherent memory aand contiguous memory. It's my mistake.

So I checked dma_alloc_from_contiguous and found dev_get_cma_area function.
The dev_get_cma_area returns device-specific cma if it exists or default global-cma.
I think __alloc_from_contiguous doesn't distinguish device-specific cma area and global cma.
The purpose of __alloc_from_contiguous is allocation of contiguous memory from any cma area, not device-specific area.

If my assumption is right, __alloc_from_contiguous can be replaced with __alloc_remap_buffer without checking device-specific cma area.

What do you think about it?


Thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/