Hi Joerg,

On Sun, 30 Jan 2022 08:43:19 +0100, Joerg Roedel <j...@8bytes.org> wrote:

> Hi Jacob, Baolu,
> 
> On Fri, Jan 28, 2022 at 11:10:01AM +0800, Lu Baolu wrote:
> > During PCI bus rescan, adding new devices involve two notifiers.
> > 1. dmar_pci_bus_notifier()
> > 2. iommu_bus_notifier()
> > The current code sets #1 as low priority (INT_MIN) which resulted in #2
> > being invoked first. The result is that struct device pointer cannot be
> > found in DRHD search for the new device's DMAR/IOMMU. Subsequently, the
> > device is put under the "catch-all" IOMMU instead of the correct one.  
> 
> There are actually iommu_ops pointers invoked from iommu_bus_notifier()
> into IOMMU driver code. Can those be used to enforce the ordering in a
> more reliable way?
> 
The race condition is between PCI/ACPI and IOMMU subsystems, I don't see
how having IOMMU internal ops can solve the external race.  Perhaps we
should merge into one notifier to have direct control of the ordering, is
that what you are suggesting? It seems to be a good albeit larger clean-up
I can look into.

Thanks,

Jacob
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to