@@ -768,11 +768,14 @@ static bool swiotlb_free_buffer(struct device *dev, size_t size,
static void
swiotlb_full(struct device *dev, size_t size, enum dma_data_direction dir,
- int do_panic)
+ unsigned long attrs, int do_panic)
{
if (swiotlb_force == SWIOTLB_NO_FORCE)
return;
+ if (attrs & DMA_ATTR_NO_WARN)
+ return;
+
/*
* Ran out of IOMMU space for this operation. This is very bad.
* Unfortunately the drivers cannot handle this operation properly.
@@ -823,7 +826,7 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page,
/* Oh well, have to allocate and map a bounce buffer. */
map = map_single(dev, phys, size, dir, attrs);
if (map == SWIOTLB_MAP_ERROR) {
- swiotlb_full(dev, size, dir, 1);
+ swiotlb_full(dev, size, dir, attrs, 1);
return __phys_to_dma(dev, io_tlb_overflow_buffer);
}
@@ -959,7 +962,7 @@ swiotlb_map_sg_attrs(struct device *hwdev, struct scatterlist *sgl, int nelems,
if (map == SWIOTLB_MAP_ERROR) {
/* Don't panic here, we expect map_sg users
to do proper error handling. */
- swiotlb_full(hwdev, sg->length, dir, 0);
+ swiotlb_full(hwdev, sg->length, dir, attrs, 0);
attrs |= DMA_ATTR_SKIP_CPU_SYNC;
swiotlb_unmap_sg_attrs(hwdev, sgl, i, dir,
attrs);