Hi Cheeramvelil & Hilman,
I found this patch do not ACK into the kernel mainline, and there is an obvious logical error.
commit 7f00db6493e69a3b6b7b9929218b127c62e6a53b Author: Vinil Cheeramvelil vinil.cheeramvelil@intel.com Date: Wed Jul 8 10:35:06 2015 +0800
ion: Handle the memory mapping correctly on x86
This patch modifies the ion page pool code to address limitation in x86 PAT. When one physical page is mapped to multiple virtual pages, the same cache policy should be used. Add set_memory_wc/uc call to avoid aliases. If not, all mappings will be cached(write back).
Change-Id: I98ee8902df0c80135dddfa998c4ca4c2bb44e40e Signed-off-by: Zhebin Jin zhebin.jin@intel.com Signed-off-by: Vinil Cheeramvelil vinil.cheeramvelil@intel.com
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index da2a63c..1f9feb7 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -85,8 +85,10 @@ static void free_buffer_page(struct ion_system_heap *heap,
if (!cached && !(buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE)) { struct ion_page_pool *pool = heap->pools[order_to_index(order)]; - - ion_page_pool_free(pool, page); + if (buffer->private_flags & ION_PRIV_FLAG_SHRINKER_FREE) + ion_page_pool_free_immediate(pool, page); + else + ion_page_pool_free(pool, page);
the if else here is totally redundant } else { __free_pages(page, order); }