Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

swiotlb: fix inversed DMA_ATTR_NO_WARN test

The result was printing the warning only when we were explicitly asked
not to.

Cc: stable@vger.kernel.org
Fixes: 0176adb004065d6815a8e67946752df4cd947c5b "swiotlb: refactor
coherent buffer allocation"
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>.
Signed-off-by: Christoph Hellwig <hch@lst.de>

authored by

Michel Dänzer and committed by
Christoph Hellwig
892a0be4 2d618bdf

+1 -1
+1 -1
lib/swiotlb.c
··· 737 737 swiotlb_tbl_unmap_single(dev, phys_addr, size, DMA_TO_DEVICE, 738 738 DMA_ATTR_SKIP_CPU_SYNC); 739 739 out_warn: 740 - if ((attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) { 740 + if (!(attrs & DMA_ATTR_NO_WARN) && printk_ratelimit()) { 741 741 dev_warn(dev, 742 742 "swiotlb: coherent allocation failed, size=%zu\n", 743 743 size);