diff options
author | Claire Chang <tientzu@chromium.org> | 2021-06-19 11:40:34 +0800 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad@kernel.org> | 2021-07-13 20:04:37 -0400 |
commit | 69031f500865ee3eee19566a1b9c40a189817eaa (patch) | |
tree | c14936547a4f2e44f4b9ee89b415766a7975b364 /drivers/base/core.c | |
parent | 6e675a1c455ea7579c7eaf1a38fe64267039d6fe (diff) | |
download | linux-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.c | 4 |
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); |