non_page memory cache will only be freed when application exit.
It will have waste when contiguous memory used up.
Add logic to free it when contiguous memory is used up.
[DATE]16-12-2013
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Shawn Guo
&mdl->dmaHandle,
GFP_KERNEL | gcdNOWARN);
}
+#if gcdUSE_NON_PAGED_MEMORY_CACHE
+ if(addr == gcvNULL)
+ {
+ /*Free all cache and try again*/
+ _FreeAllNonPagedMemoryCache(Os);
+ addr = dma_alloc_coherent(gcvNULL,
+ mdl->numPages * PAGE_SIZE,
+ &mdl->dmaHandle,
+ GFP_KERNEL | gcdNOWARN);
+ }
+#endif
#else
size = mdl->numPages * PAGE_SIZE;
order = get_order(size);