On 8/24/2012 12:09 PM, Rebecca Schultz Zavin wrote:
You are correct, there is a bug in map_kernel for the contigious heap -- it's bit rotted a bit as it's not in use on the program I am currently working on. It shouldn't be using ioremap, it should be using vmap for highmem or can just return the mapping for lowmem if appropriate. I will take a patch that fixes this or fix it myself when I get a chance.
But ION use dma_sync_sg_for_devices() to flush cache that means they're using linear address from page. So they're using the NOT-EXISTED virtual address that is removed by memblock_remove().
When I modified ion to use the dma api's I made a conscious decision to stop supporting memory that was removed from the kernel. The benefits of the dma api's outweighed the small cost of having the metadata around in my mind. Memory for contiguous heaps can be put aside using memblock_reserve instead.
I'm concerned about dropping support for memblock_remove'd memory. On ARMv7 targets, this places a restriction on only having carveout regions in highmem to avoid the multiple mapping problems if we need to use writecombined memory. This thread has established that using the dma apis on memory reserved with memblock_remove can't happen, but what about memory that just needs to be uncached? This seems like an appropriate use of memblock_remove, especially for lowmem areas.
Also, what about targets that lack highmem?
Laura
Linaro-mm-sig mailing list Linaro-mm-sig@lists.linaro.org http://lists.linaro.org/mailman/listinfo/linaro-mm-sig