diff options
author | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2020-07-06 20:17:30 +0300 |
---|---|---|
committer | Oleksandr Suvorov <oleksandr.suvorov@toradex.com> | 2020-07-06 20:24:05 +0300 |
commit | d6e1cff14875d6ce338c1f27afe0639ef0f97b79 (patch) | |
tree | 2449859b19a9e58abb0414700621a86f234d91d6 /drivers/staging/android/ion/ion_cma_heap.c | |
parent | 453fdfde79e13e27030a56c7ea787e98698b0dba (diff) | |
parent | 0347fe7527d062e1762498cb5863bcd5bde0997b (diff) |
Merge branch 'imx_4.14.98_2.3.0' into toradex_4.14-2.3.x-imx
Fix conflicts after merging changes from the latest NXP branch.
Conflicts:
arch/arm64/boot/dts/freescale/fsl-imx8qm-device.dtsi
drivers/pci/dwc/pci-imx6.c
Related-to: ELB-1306
Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
Diffstat (limited to 'drivers/staging/android/ion/ion_cma_heap.c')
-rw-r--r-- | drivers/staging/android/ion/ion_cma_heap.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c index fa3e4b7e0c9f..8589eff9b77f 100644 --- a/drivers/staging/android/ion/ion_cma_heap.c +++ b/drivers/staging/android/ion/ion_cma_heap.c @@ -22,6 +22,10 @@ #include <linux/cma.h> #include <linux/scatterlist.h> #include <linux/highmem.h> +#include <asm/cacheflush.h> +#ifdef CONFIG_ARM +#include <asm/outercache.h> +#endif #include "ion.h" @@ -55,17 +59,36 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, if (PageHighMem(pages)) { unsigned long nr_clear_pages = nr_pages; struct page *page = pages; +#ifdef CONFIG_ARM + phys_addr_t base = __pfn_to_phys(page_to_pfn(pages)); + phys_addr_t end = base + size; +#endif while (nr_clear_pages > 0) { void *vaddr = kmap_atomic(page); memset(vaddr, 0, PAGE_SIZE); +#ifdef CONFIG_ARM + __cpuc_flush_dcache_area(vaddr,PAGE_SIZE); +#else + __flush_dcache_area(vaddr,PAGE_SIZE); +#endif kunmap_atomic(vaddr); page++; nr_clear_pages--; } +#ifdef CONFIG_ARM + outer_flush_range(base, end); +#endif } else { - memset(page_address(pages), 0, size); + void *ptr = page_address(pages); + memset(ptr, 0, size); +#ifdef CONFIG_ARM + __cpuc_flush_dcache_area(ptr,size); + outer_flush_range(__pa(ptr), __pa(ptr) + size); +#else + __flush_dcache_area(ptr,size); +#endif } table = kmalloc(sizeof(*table), GFP_KERNEL); |