iommu/amd: Wait for completion of IOTLB flush in attach_device
authorFilippo Sironi <sironi@amazon.de>
Tue, 10 Sep 2019 17:49:21 +0000 (19:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:46:47 +0000 (14:46 +0100)
[ Upstream commit 0b15e02f0cc4fb34a9160de7ba6db3a4013dc1b7 ]

To make sure the domain tlb flush completes before the
function returns, explicitly wait for its completion.

Signed-off-by: Filippo Sironi <sironi@amazon.de>
Fixes: 42a49f965a8d ("amd-iommu: flush domain tlb when attaching a new device")
[joro: Added commit message and fixes tag]
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/amd_iommu.c

index d09c24825734eb2cfc288418f22139066efedcb4..778f167be2d3517656799bd609f84d53765457a3 100644 (file)
@@ -2160,6 +2160,8 @@ skip_ats_check:
         */
        domain_flush_tlb_pde(domain);
 
+       domain_flush_complete(domain);
+
        return ret;
 }