Skip to content

Commit

Permalink
Merge tag 'dma-mapping-5.18-2' of git://git.infradead.org/users/hch/d…
Browse files Browse the repository at this point in the history
…ma-mapping

Pull dma-mapping fix from Christoph Hellwig:

 - avoid a double memory copy for swiotlb (Chao Gao)

* tag 'dma-mapping-5.18-2' of git://git.infradead.org/users/hch/dma-mapping:
  dma-direct: avoid redundant memory sync for swiotlb
  • Loading branch information
torvalds committed Apr 16, 2022
2 parents 59250f8 + 9e02977 commit b008683
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/dma/direct.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static inline void dma_direct_unmap_page(struct device *dev, dma_addr_t addr,
dma_direct_sync_single_for_cpu(dev, addr, size, dir);

if (unlikely(is_swiotlb_buffer(dev, phys)))
swiotlb_tbl_unmap_single(dev, phys, size, dir, attrs);
swiotlb_tbl_unmap_single(dev, phys, size, dir,
attrs | DMA_ATTR_SKIP_CPU_SYNC);
}
#endif /* _KERNEL_DMA_DIRECT_H */

0 comments on commit b008683

Please sign in to comment.