Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84b3a0bc authored by Joerg Roedel's avatar Joerg Roedel
Browse files

iommu/amd: Flush the IOMMU TLB before the addresses are freed



This allows to keep the bitmap_lock only for a very short
period of time.

Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 53b3b65a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2527,14 +2527,14 @@ static void __unmap_single(struct dma_ops_domain *dma_dom,
		start += PAGE_SIZE;
	}

	SUB_STATS_COUNTER(alloced_io_mem, size);

	dma_ops_free_addresses(dma_dom, dma_addr, pages);

	if (amd_iommu_unmap_flush || dma_dom->need_flush) {
		domain_flush_pages(&dma_dom->domain, flush_addr, size);
		dma_dom->need_flush = false;
	}

	SUB_STATS_COUNTER(alloced_io_mem, size);

	dma_ops_free_addresses(dma_dom, dma_addr, pages);
}

/*