aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorGravatar Claire Chang <tientzu@chromium.org> 2021-06-19 11:40:34 +0800
committerGravatar Konrad Rzeszutek Wilk <konrad@kernel.org> 2021-07-13 20:04:37 -0400
commit69031f500865ee3eee19566a1b9c40a189817eaa (patch)
treec14936547a4f2e44f4b9ee89b415766a7975b364 /drivers/base/core.c
parentswiotlb: Refactor swiotlb_create_debugfs (diff)
downloadlinux-69031f500865ee3eee19566a1b9c40a189817eaa.tar.gz
linux-69031f500865ee3eee19566a1b9c40a189817eaa.tar.bz2
linux-69031f500865ee3eee19566a1b9c40a189817eaa.zip
swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used
Always have the pointer to the swiotlb pool used in struct device. This could help simplify the code for other pools. Signed-off-by: Claire Chang <tientzu@chromium.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Tested-by: Stefano Stabellini <sstabellini@kernel.org> Tested-by: Will Deacon <will@kernel.org> Acked-by: Stefano Stabellini <sstabellini@kernel.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index cadcade65825..ea5b85354526 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -27,6 +27,7 @@
#include <linux/netdevice.h>
#include <linux/sched/signal.h>
#include <linux/sched/mm.h>
+#include <linux/swiotlb.h>
#include <linux/sysfs.h>
#include <linux/dma-map-ops.h> /* for dma_default_coherent */
@@ -2846,6 +2847,9 @@ void device_initialize(struct device *dev)
defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL)
dev->dma_coherent = dma_default_coherent;
#endif
+#ifdef CONFIG_SWIOTLB
+ dev->dma_io_tlb_mem = io_tlb_default_mem;
+#endif
}
EXPORT_SYMBOL_GPL(device_initialize);