OSDN Git Service

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>
Wed, 29 Jan 2020 09:21:48 +0000 (10:21 +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 0ad8b7c..66a406e 100644 (file)
@@ -2184,6 +2184,8 @@ static int attach_device(struct device *dev,
         */
        domain_flush_tlb_pde(domain);
 
+       domain_flush_complete(domain);
+
        return ret;
 }