Re: [PATCH v2] PCI: Disable ATS via quirk before notifying IOMMU drivers

From: David Matlack

Date: Tue Mar 31 2026 - 14:50:20 EST


On Tue, Mar 31, 2026 at 11:38 AM Bjorn Helgaas <helgaas@xxxxxxxxxx> wrote:
>
> On Tue, Mar 31, 2026 at 09:01:53AM -0700, David Matlack wrote:
> > On Fri, Mar 27, 2026 at 2:17 PM David Matlack <dmatlack@xxxxxxxxxx> wrote:
> >
> > > /* AMD Raven platform iGPU */
> > > -DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats);
> > > +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_ATI, 0x15d8, quirk_amd_harvest_no_ats);
> >
> > Sashiko found a bug here that would leave ATS enabled on this device:
> >
> > https://sashiko.dev/#/patchset/20260327211649.3816010-1-dmatlack%40google.com?patch=12646
>
> Do you want to update the patch to use DECLARE_PCI_FIXUP_HEADER
> instead of DECLARE_PCI_FIXUP_EARLY, as Sashiko suggested?
>
> I don't know the IOMMU init ordering with respect to PCI enumeration,
> but header fixups are run in pci_device_add() before it calls
> device_add().

Yes I would like to work on another version. I have 3 things I want to
investigate/fix:

* Fix the bug Sashiko found with early vs. header fixups.
* Investigate whether no_ats be a u8 instead of unsigned int to avoid
increasing sizeof(struct pci_dev).
* Investigate Boalu's finding. Maybe this issue is specific to VF
creation, and changing the order of calls there would be a better
solution.