RE: [PATCH v3 04/12] iommu/vt-d: Move scalable mode ATS enablement to probe path

From: Tian, Kevin
Date: Tue Mar 04 2025 - 03:16:17 EST


> From: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Sent: Friday, February 28, 2025 5:26 PM
>
> Device ATS is currently enabled when a domain is attached to the device
> and disabled when the domain is detached. This creates a limitation:
> when the IOMMU is operating in scalable mode and IOPF is enabled, the
> device's domain cannot be changed.

could you extend it with your earlier reply?

https://lore.kernel.org/linux-iommu/6a418974-d06e-46e3-879f-ab4c84a95231@xxxxxxxxxxxxxxx/

>
> -static void iommu_enable_pci_caps(struct device_domain_info *info)
> +static void iommu_enable_pci_ats(struct device_domain_info *info)
> {
> struct pci_dev *pdev;
>
> - if (!dev_is_pci(info->dev))
> + if (!info->ats_supported)
> return;
>
> pdev = to_pci_dev(info->dev);
> - if (info->ats_supported && pci_ats_page_aligned(pdev) &&
> - !pci_enable_ats(pdev, VTD_PAGE_SHIFT))
> + if (!pci_ats_page_aligned(pdev))
> + return;
> +
> + if (!pci_enable_ats(pdev, VTD_PAGE_SHIFT))
> info->ats_enabled = 1;
> }
>

still prefer to some comment above as you explained in above
reply. It's not obvious w/o knowing the tricky background.