Skip to content

Commit

Permalink
dma-direct: use is_swiotlb_active in dma_direct_map_page
Browse files Browse the repository at this point in the history
Use the more specific is_swiotlb_active check instead of checking the
global swiotlb_force variable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
  • Loading branch information
Christoph Hellwig committed Apr 18, 2022
1 parent b2d229d commit 0741055
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/dma/direct.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev,
return swiotlb_map(dev, phys, size, dir, attrs);

if (unlikely(!dma_capable(dev, dma_addr, size, true))) {
if (swiotlb_force != SWIOTLB_NO_FORCE)
if (is_swiotlb_active(dev))
return swiotlb_map(dev, phys, size, dir, attrs);

dev_WARN_ONCE(dev, 1,
Expand Down

0 comments on commit 0741055

Please sign in to comment.