Re: [PATCH] iommu/riscv: Add dependency between iommu and devices

From: wang.yechao255

Date: Mon Jun 08 2026 - 21:07:33 EST


> On Mon, Jun 8, 2026 at 11:52 AM <wang.yechao255@xxxxxxxxxx> wrote:
> >
> > > >
> > > > From: Wang Yechao <wang.yechao255@xxxxxxxxxx>
> > > >
> > > > Commit 9156585280f1 ("ACPI: RIMT: Add dependency between iommu and
> > > > devices") adds the dependency between iommu and devices on ACPI
> > > > systems. On devicetree systems, the incorrect removal order also
> > > > occurs.
> > > >
> > > Interesting. Why is it not handled by the fw_devlink infrastructure in DT?
> > >
> > > Thanks,
> > > Sunil
> >
> > Thank you. I have noticed that commit e149573b2f84 ("of: property: Add device
> > link support for "iommu-map"") adds support for "iommu-map" to the device link
> > supplier bindings, so that probing of PCI devices can be deferred until after
> > the IOMMU is available.
> >
> > The QEMU RISC-V virt machine currently lacks the "iommu-map" property for the
> > PCIe bus when the iommu-pci device is used, which leads to this issue. Therefore,
> > I believe the correct fix is to add the "iommu-map" property for PCIe in QEMU.
> >
> For PCI IOMMU, the dependency should be automatically taken care since iommu
> should always be the first device in the hierarchy and scanned first.

Thank you for pointing it out. The device is not removed before the PCI IOMMU
device because the BDF of the device I configured is smaller than the BDF of
the PCI IOMMU device.

Regards,
Yechao