summaryrefslogtreecommitdiff
path: root/kernel/dma/direct.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2020-08-17 17:41:50 +0300
committerChristoph Hellwig <hch@lst.de>2020-09-11 10:10:17 +0300
commitabdaf11ac18925ce8cc229e62e35b342d548ece2 (patch)
treec32d6fd1625f6835947ca94130ca0942ef47ad01 /kernel/dma/direct.c
parentef1a85b6ca093abb00fbc38ea55fd9ae08ab05ef (diff)
downloadlinux-abdaf11ac18925ce8cc229e62e35b342d548ece2.tar.xz
dma-mapping: add (back) arch_dma_mark_clean for ia64
Add back a hook to optimize dcache flushing after reading executable code using DMA. This gets ia64 out of the business of pretending to be dma incoherent just for this optimization. Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'kernel/dma/direct.c')
-rw-r--r--kernel/dma/direct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/dma/direct.c b/kernel/dma/direct.c
index db6ef07aec3b..949c1cbf08b2 100644
--- a/kernel/dma/direct.c
+++ b/kernel/dma/direct.c
@@ -345,6 +345,9 @@ void dma_direct_sync_sg_for_cpu(struct device *dev,
if (unlikely(is_swiotlb_buffer(paddr)))
swiotlb_tbl_sync_single(dev, paddr, sg->length, dir,
SYNC_FOR_CPU);
+
+ if (dir == DMA_FROM_DEVICE)
+ arch_dma_mark_clean(paddr, sg->length);
}
if (!dev_is_dma_coherent(dev))