diff options
author | Tony Lindgren <tony@atomide.com> | 2015-07-06 14:33:17 +0200 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2015-07-06 14:33:17 +0200 |
commit | ae745302c0a3e2b5b768690f631fc14db44467e7 (patch) | |
tree | 1db4d210a7419286b447dc09fa7400a561d55f42 /arch/arc/mm/dma.c | |
parent | ARM: OMAP2+: Remove unnessary return statement from the void function, omap2_... (diff) | |
parent | ARM: dts: am4372.dtsi: disable rfbi (diff) | |
download | linux-ae745302c0a3e2b5b768690f631fc14db44467e7.tar.xz linux-ae745302c0a3e2b5b768690f631fc14db44467e7.zip |
Merge branch 'fixes-rc1' into omap-for-v4.2/fixes
Diffstat (limited to 'arch/arc/mm/dma.c')
-rw-r--r-- | arch/arc/mm/dma.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/arc/mm/dma.c b/arch/arc/mm/dma.c index 12cc6485b218..74a637a1cfc4 100644 --- a/arch/arc/mm/dma.c +++ b/arch/arc/mm/dma.c @@ -14,8 +14,6 @@ * Cache bit off in the TLB entry. * * The default DMA address == Phy address which is 0x8000_0000 based. - * A platform/device can make it zero based, by over-riding - * plat_{dma,kernel}_addr_to_{kernel,dma} */ #include <linux/dma-mapping.h> @@ -37,7 +35,7 @@ void *dma_alloc_noncoherent(struct device *dev, size_t size, return NULL; /* This is bus address, platform dependent */ - *dma_handle = plat_kernel_addr_to_dma(dev, paddr); + *dma_handle = (dma_addr_t)paddr; return paddr; } @@ -46,8 +44,7 @@ EXPORT_SYMBOL(dma_alloc_noncoherent); void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle) { - free_pages_exact((void *)plat_dma_addr_to_kernel(dev, dma_handle), - size); + free_pages_exact((void *)dma_handle, size); } EXPORT_SYMBOL(dma_free_noncoherent); @@ -67,7 +64,19 @@ void *dma_alloc_coherent(struct device *dev, size_t size, memset(kvaddr, 0, size); /* This is bus address, platform dependent */ - *dma_handle = plat_kernel_addr_to_dma(dev, paddr); + *dma_handle = (dma_addr_t)paddr; + + /* + * Evict any existing L1 and/or L2 lines for the backing page + * in case it was used earlier as a normal "cached" page. + * Yeah this bit us - STAR 9000898266 + * + * Although core does call flush_cache_vmap(), it gets kvaddr hence + * can't be used to efficiently flush L1 and/or L2 which need paddr + * Currently flush_cache_vmap nukes the L1 cache completely which + * will be optimized as a separate commit + */ + dma_cache_wback_inv((unsigned long)paddr, size); return kvaddr; } @@ -78,8 +87,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *kvaddr, { iounmap((void __force __iomem *)kvaddr); - free_pages_exact((void *)plat_dma_addr_to_kernel(dev, dma_handle), - size); + free_pages_exact((void *)dma_handle, size); } EXPORT_SYMBOL(dma_free_coherent); |