Commit fc3523b1 authored by Nicolin Chen's avatar Nicolin Chen Committed by Joerg Roedel
Browse files

iommu: Fix ATS invalidation timeouts during __iommu_remove_group_pasid()

If a device is blocked, its PASID domains are already detached. Repeating
iommu_remove_dev_pasid() is unnecessary and might trigger ATS invalidation
timeouts.

Skip the iommu_remove_dev_pasid() call upon gdev->blocked.

Fixes: c279e839 ("iommu: Introduce pci_dev_reset_iommu_prepare/done()")
Cc: stable@vger.kernel.org
Closes: https://sashiko.dev/#/patchset/20260407194644.171304-1-nicolinc%40nvidia.com


Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Signed-off-by: default avatarNicolin Chen <nicolinc@nvidia.com>
Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
parent 0d5fd7a9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3602,7 +3602,12 @@ static void __iommu_remove_group_pasid(struct iommu_group *group,
	struct group_device *device;

	for_each_group_device(group, device) {
		if (device->dev->iommu->max_pasids > 0)
		/*
		 * A group-level detach cannot fail, even if there is a blocked
		 * device. In fact, blocked devices must be already detached for
		 * a pending device recovery.
		 */
		if (!device->blocked && device->dev->iommu->max_pasids > 0)
			iommu_remove_dev_pasid(device->dev, pasid, domain);
	}
}