Re: [PATCH v8 1/4] PCI/ATS: Ensure pci_ats_supported() is PF-aware for VFs

From: Bjorn Helgaas

Date: Fri Jun 12 2026 - 10:35:12 EST


On Thu, Jun 04, 2026 at 06:21:13PM +0000, Pranjal Shrivastava wrote:
> Update pci_ats_supported() to additionally check the associated PF's
> status when called on a VF. This ensures that PF-level quirks and
> untrusted status are correctly propagated to VFs, providing a robust
> support check that aligns with the kernel's PF-centric ATS configuration
> model and is immune to the timing of VF-specific fixups.
>
> Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Reviewed-by: Samiullah Khawaja <skhawaja@xxxxxxxxxx>
> Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> Reviewed-by: Lu Baolu <baolu.lu@xxxxxxxxxxxxxxx>
> Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>
> Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>

Acked-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>

This series looks like material for the IOMMU tree? Let me know if
you prefer merging these via PCI.

> ---
> drivers/pci/ats.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/ats.c b/drivers/pci/ats.c
> index 96efa00d9743..679a3c3c1d54 100644
> --- a/drivers/pci/ats.c
> +++ b/drivers/pci/ats.c
> @@ -40,10 +40,13 @@ void pci_ats_init(struct pci_dev *dev)
> */
> bool pci_ats_supported(struct pci_dev *dev)
> {
> - if (!dev->ats_cap)
> + if (!dev->ats_cap || dev->untrusted)
> return false;
>
> - return (dev->untrusted == 0);
> + if (dev->is_virtfn)
> + return pci_ats_supported(pci_physfn(dev));
> +
> + return true;
> }
> EXPORT_SYMBOL_GPL(pci_ats_supported);
>
> --
> 2.54.0.1032.g2f8565e1d1-goog
>