On Thu, Aug 23, 2012 at 10:49 PM, Laura Abbott lauraa@codeaurora.org wrote:
On 8/23/2012 2:30 AM, Haojian Zhuang wrote:
Solution #1. .map_kernel() only returns the linear address. And there's a limitation of this solution, the heap should be always lying in low memory. So we needn't use any ioremap() and memblock_remove() any more.
How would you reserve a large block of lowmem without calling memblock_remove? The other issue is that if the memory is carved out for Ion, it can't be used for anything else. The lowmem is pretty much wasted if it's not being used constantly.
Also, if you actually want uncached carveout memory this won't work because you can't get an uncached mapping.
Em, an uncached mapping is the real problem.
Solution #2. Use vmap() in .map_kernel().
vmap won't work because it relies on the page structures being valid.
While memory buffer is allocated, physical address is also known. So we can get page structure by phys_to_page(). And we also need to create a page array to store those page structures.