diff options
author | Claire Chang <tientzu@chromium.org> | 2021-06-24 17:55:20 +0200 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad@kernel.org> | 2021-07-14 02:04:43 +0200 |
commit | 903cd0f315fe426c6a64c54ed389de0becb663dc (patch) | |
tree | 5fc7baecb38bf0154a1438d00469658ac0164041 /kernel/dma/direct.h | |
parent | swiotlb: Update is_swiotlb_active to add a struct device argument (diff) | |
download | linux-903cd0f315fe426c6a64c54ed389de0becb663dc.tar.xz linux-903cd0f315fe426c6a64c54ed389de0becb663dc.zip |
swiotlb: Use is_swiotlb_force_bounce for swiotlb data bouncing
Propagate the swiotlb_force into io_tlb_default_mem->force_bounce and
use it to determine whether to bounce the data or not. This will be
useful later to allow for different 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>
[v2: Includes Will's fix]
Diffstat (limited to 'kernel/dma/direct.h')
-rw-r--r-- | kernel/dma/direct.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h index 13e9e7158d94..4632b0f4f72e 100644 --- a/kernel/dma/direct.h +++ b/kernel/dma/direct.h @@ -87,7 +87,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev, phys_addr_t phys = page_to_phys(page) + offset; dma_addr_t dma_addr = phys_to_dma(dev, phys); - if (unlikely(swiotlb_force == SWIOTLB_FORCE)) + if (is_swiotlb_force_bounce(dev)) return swiotlb_map(dev, phys, size, dir, attrs); if (unlikely(!dma_capable(dev, dma_addr, size, true))) { |