summaryrefslogtreecommitdiff
path: root/kernel/dma/swiotlb.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-12-14 12:33:31 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2018-12-14 12:33:31 +0100
commitbb22dc14a2c29f6efef40ee72344c5d283a92987 (patch)
tree90938fc65a1c67ce3afbf3ccae7f10250a696332 /kernel/dma/swiotlb.c
parentfca91f6d60b6ee53b8d43c8ad5bad153a758961c (diff)
parent211929fd3f7c8de4d541b1cc243b82830e5ea1e8 (diff)
Merge branch 'khdr_fix' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest into HEAD
Merge topic branch from Shuah.
Diffstat (limited to 'kernel/dma/swiotlb.c')
-rw-r--r--kernel/dma/swiotlb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index 5731daa09a32..045930e32c0e 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -679,7 +679,8 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
}
if (!dev_is_dma_coherent(dev) &&
- (attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
+ (attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0 &&
+ dev_addr != DIRECT_MAPPING_ERROR)
arch_sync_dma_for_device(dev, phys, size, dir);
return dev_addr;