On 2020/6/22 下午7:55, Joerg Roedel wrote:
On Thu, Jun 04, 2020 at 09:33:07PM +0800, Zhangfei Gao wrote:
@@ -2418,6 +2418,10 @@ int iommu_fwspec_init(struct device *dev, struct
fwspec->iommu_fwnode = iommu_fwnode;
fwspec->ops = ops;
+ if (dev_is_pci(dev))
+ pci_fixup_device(pci_fixup_final, to_pci_dev(dev));
That's not going to fly, I don't think we should run the fixups twice,
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
Thanks for looking this.
Yes, it is the only reason calling fixup secondly after iommu_fwspec is
The first time fixup final is very early in pci_bus_add_device.
If allocating iommu_fwspec earlier, it maybe in pci_alloc_dev.
And assigning ops still in iommu_fwspec_init.
Have tested it works.
Not sure is it acceptable?
Alternatively, adding can_stall to struct pci_dev is simple but ugly too,
since pci does not know stall now.
iommu mailing list