diff options
author | Christoph Hellwig <hch@lst.de> | 2017-08-27 10:35:40 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-10-19 16:37:44 +0200 |
commit | e0c6584df9c414b50de17e1abc1099f7501bbb60 (patch) | |
tree | a683b944a85576069343932bd4fe2fa78284074a /arch/sh/mm | |
parent | xtensa: make dma_cache_sync a no-op (diff) | |
download | linux-e0c6584df9c414b50de17e1abc1099f7501bbb60.tar.xz linux-e0c6584df9c414b50de17e1abc1099f7501bbb60.zip |
sh: make dma_cache_sync a no-op
sh does not implement DMA_ATTR_NON_CONSISTENT allocations, so it doesn't
make any sense to do any work in dma_cache_sync given that it
must be a no-op when dma_alloc_attrs returns coherent memory.
On the other hand sh uses dma_cache_sync internally in the dma_ops
implementation and for the maple bus that does not use the DMA API,
so a the old functionality for dma_cache_sync is still provided under
the name sh_sync_dma_for_device, and without the redundant dev
argument. While at it two of the syncing dma_ops also go the proper
_for_device postfix.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/consistent.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/sh/mm/consistent.c b/arch/sh/mm/consistent.c index d1275adfa0ef..6ea3aab508f2 100644 --- a/arch/sh/mm/consistent.c +++ b/arch/sh/mm/consistent.c @@ -49,7 +49,7 @@ void *dma_generic_alloc_coherent(struct device *dev, size_t size, * Pages from the page allocator may have data present in * cache. So flush the cache before using uncached memory. */ - dma_cache_sync(dev, ret, size, DMA_BIDIRECTIONAL); + sh_sync_dma_for_device(ret, size, DMA_BIDIRECTIONAL); ret_nocache = (void __force *)ioremap_nocache(virt_to_phys(ret), size); if (!ret_nocache) { @@ -78,7 +78,7 @@ void dma_generic_free_coherent(struct device *dev, size_t size, iounmap(vaddr); } -void dma_cache_sync(struct device *dev, void *vaddr, size_t size, +void sh_sync_dma_for_device(void *vaddr, size_t size, enum dma_data_direction direction) { void *addr; @@ -100,7 +100,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size, BUG(); } } -EXPORT_SYMBOL(dma_cache_sync); +EXPORT_SYMBOL(sh_sync_dma_for_device); static int __init memchunk_setup(char *str) { |