On Mon, Dec 12 2022 at 11:47, Jason Gunthorpe wrote: > On Mon, Dec 12, 2022 at 04:17:58PM +0100, Thomas Gleixner wrote: >> Obvioulsy unless it's done somewhere early in the PCI discovery, >> i.e. before the discovery associated the domain pointer. > > I thought the problem is more that the iommu drivers change the > assigned irq_domain: Yes they do. > void intel_irq_remap_add_device(struct dmar_pci_notify_info *info) > { > if (!irq_remapping_enabled || pci_dev_has_special_msi_domain(info->dev)) > return; > > dev_set_msi_domain(&info->dev->dev, map_dev_to_ir(info->dev)); > } > > Which is ultimately called by > > bus_register_notifier(&pci_bus_type, &dmar_pci_bus_nb); > > And that compares with the iommu setup which is also done from a > bus notifier: > > nb[i].notifier_call = iommu_bus_notifier; > bus_register_notifier(iommu_buses[i], &nb[i]); > > So, I think, there is not reliable ordering between these two things. Bah. Notifiers are a complete disaster vs. ordering. This really wants reliable ordering IMO. Thanks, tglx