From: Vasant Hegde Date: Wed, 22 Nov 2023 09:02:08 +0000 (+0000) Subject: iommu/amd: Remove redundant domain flush from attach_device() X-Git-Tag: v6.8-rc1~49^2^7~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3f2571fed2fa9e9ea61fd990a9a4fc20ca83b62e;p=thirdparty%2Fkernel%2Flinux.git iommu/amd: Remove redundant domain flush from attach_device() Domain flush was introduced in attach_device() path to handle kdump scenario. Later init code was enhanced to handle kdump scenario where it also takes care of flushing everything including TLB (see early_enable_iommus()). Hence remove redundant flush from attach_device() function. Signed-off-by: Vasant Hegde Reviewed-by: Suravee Suthikulpanit Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20231122090215.6191-3-vasant.hegde@amd.com Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index c2578b567e35c..2330766863793 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -1896,15 +1896,6 @@ static int attach_device(struct device *dev, do_attach(dev_data, domain); - /* - * We might boot into a crash-kernel here. The crashed kernel - * left the caches in the IOMMU dirty. So we have to flush - * here to evict all dirty stuff. - */ - amd_iommu_domain_flush_tlb_pde(domain); - - amd_iommu_domain_flush_complete(domain); - out: spin_unlock(&dev_data->lock);