On Thu, Jun 04, 2020 at 09:33:07PM +0800, Zhangfei Gao wrote:Thanks for looking this.
+++ b/drivers/iommu/iommu.cThat's not going to fly, I don't think we should run the fixups twice,
@@ -2418,6 +2418,10 @@ int iommu_fwspec_init(struct device *dev, struct
fwnode_handle *iommu_fwnode,
ÂÂÂÂÂÂÂ fwspec->iommu_fwnode = iommu_fwnode;
ÂÂÂÂÂÂÂ fwspec->ops = ops;
ÂÂÂÂÂÂÂ dev_iommu_fwspec_set(dev, fwspec);
+
+ÂÂÂÂÂÂ if (dev_is_pci(dev))
+ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ pci_fixup_device(pci_fixup_final, to_pci_dev(dev));
+
and they should not be run from IOMMU code. Is the only reason for this
second pass that iommu_fwspec is not yet allocated when it runs the
first time? I ask because it might be easier to just allocate the struct
earlier then.