From: Joerg Roedel <jroedel@suse.de>
Date: Fri, 13 Oct 2017 14:32:37 +0200
Subject: iommu/amd: Finish TLB flush in amd_iommu_unmap()
Git-commit: ce76353f169a6471542d999baf3d29b121dce9c0
Patch-mainline: v4.14-rc5
References: bsc#1106105

The function only sends the flush command to the IOMMU(s),
but does not wait for its completion when it returns. Fix
that.

Fixes: 601367d76bd1 ('x86/amd-iommu: Remove iommu_flush_domain function')
Cc: stable@vger.kernel.org # >= 2.6.33
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
 drivers/iommu/amd_iommu.c | 1 +
 1 file changed, 1 insertion(+)

--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -2717,6 +2717,7 @@ static int amd_iommu_unmap(struct iommu_
 	mutex_unlock(&domain->api_lock);
 
 	domain_flush_tlb_pde(domain);
+	domain_flush_complete(domain);
 
 	return get_order(unmap_size);
 }
