]> git.baikalelectronics.ru Git - kernel.git/commit
csky: Optimize arch_sync_dma_for_cpu/device with dma_inv_range
authorGuo Ren <ren_guo@c-sky.com>
Tue, 30 Jul 2019 09:16:28 +0000 (17:16 +0800)
committerGuo Ren <ren_guo@c-sky.com>
Tue, 6 Aug 2019 07:15:34 +0000 (15:15 +0800)
commitec6a769b5aba403b49bdab8761d7d256b22470c3
treeb2eb9bedbf954e9301722f1cad5ddd7c426021a8
parentd7537325b681e148100c832e4e92a825d1903095
csky: Optimize arch_sync_dma_for_cpu/device with dma_inv_range

DMA_FROM_DEVICE only need to read dma data of memory into CPU cache,
so there is no need to clear cache before. Also clear + inv for
DMA_FROM_DEVICE won't cause problem, because the memory range for dma
won't be touched by software during dma working.

Changes for V2:
 - Remove clr cache and ignore the DMA_TO_DEVICE in _for_cpu.
 - Change inv to wbinv cache with DMA_FROM_DEVICE in _for_device.

Signed-off-by: Guo Ren <ren_guo@c-sky.com>
Cc: Arnd Bergmann <arnd@arndb.de>
arch/csky/include/asm/cache.h
arch/csky/mm/cachev1.c
arch/csky/mm/cachev2.c
arch/csky/mm/dma-mapping.c