[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1ccf1bed89758a5a9b57ac2ce6d11ca898a1b9ae.1537417413.git.ren_guo@c-sky.com>
Date: Thu, 20 Sep 2018 13:39:27 +0800
From: Guo Ren <ren_guo@...ky.com>
To: tglx@...utronix.de, jason@...edaemon.net, marc.zyngier@....com,
robh+dt@...nel.org, mark.rutland@....com, arnd@...db.de,
robh@...nel.org, sfr@...b.auug.org.au
Cc: linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-arch@...r.kernel.org, c-sky_gcc_upstream@...ky.com,
gnu-csky@...tor.com, green.hu@...il.com,
Guo Ren <ren_guo@...ky.com>
Subject: [PATCH V8 1/6] csky/dma: bugfix dma_sync_for_cpu/device
ref: https://lkml.org/lkml/2018/5/18/1068
map for_cpu for_device unmap
TO_DEV writeback none writeback none
TO_CPU invalidate invalidate* invalidate invalidate*
BIDIR writeback invalidate writeback invalidate
Signed-off-by: Guo Ren <ren_guo@...ky.com>
---
arch/csky/mm/dma-mapping.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/csky/mm/dma-mapping.c b/arch/csky/mm/dma-mapping.c
index 16c2087..30a2041 100644
--- a/arch/csky/mm/dma-mapping.c
+++ b/arch/csky/mm/dma-mapping.c
@@ -217,7 +217,8 @@ void arch_sync_dma_for_device(struct device *dev, phys_addr_t paddr,
break;
case DMA_FROM_DEVICE:
case DMA_BIDIRECTIONAL:
- BUG();
+ dma_wbinv_range(vaddr + offset, vaddr + offset + size);
+ break;
default:
BUG();
}
@@ -240,7 +241,7 @@ void arch_sync_dma_for_cpu(struct device *dev, phys_addr_t paddr,
switch (dir) {
case DMA_TO_DEVICE:
- BUG();
+ break;
case DMA_FROM_DEVICE:
case DMA_BIDIRECTIONAL:
dma_wbinv_range(vaddr + offset, vaddr + offset + size);
--
2.7.4
Powered by blists - more mailing lists