Commit 8b02520e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'iommu-fixes-v7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux

Pull IOMMU fix from Will Deacon:

 - Fix regression introduced by the empty MMU gather fix in -rc7, where
   the ->iotlb_sync() callback can be elided incorrectly, resulting in
   boot failures (hangs), crashes and potential memory corruption.

* tag 'iommu-fixes-v7.0-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/iommu/linux:
  iommu: Ensure .iotlb_sync is called correctly
parents acfa7a35 7e054852
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2717,6 +2717,12 @@ static size_t __iommu_unmap(struct iommu_domain *domain,

		pr_debug("unmapped: iova 0x%lx size 0x%zx\n",
			 iova, unmapped_page);
		/*
		 * If the driver itself isn't using the gather, make sure
		 * it looks non-empty so iotlb_sync will still be called.
		 */
		if (iotlb_gather->start >= iotlb_gather->end)
			iommu_iotlb_gather_add_range(iotlb_gather, iova, size);

		iova += unmapped_page;
		unmapped += unmapped_page;