When booting with devicetree, pci_request_acs() is called after the
enumeration and initialization of PCI devices, thus ACS is not enabled.
ACS should be enabled when IOMMU is detected for the PCI host bridge, so
check for IOMMU before probe of PCI host and call pci_request_acs() to make
sure ACS will be enabled when enumerating PCI devices.
Fixes: 6bf6c24720d33 ("iommu/of: Request ACS from the PCI core when configuring IOMMU linkage")
Link: https://lore.kernel.org/r/1621566204-37456-1-git-send-email-wangxingang5@huawei.com
Signed-off-by: Xingang Wang <wangxingang5@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Acked-by: Joerg Roedel <jroedel@suse.de>
.np = master_np,
};
- pci_request_acs();
err = pci_for_each_dma_alias(to_pci_dev(dev),
of_pci_iommu_init, &info);
} else {
int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge)
{
- if (!dev->of_node)
+ struct device_node *node = dev->of_node;
+
+ if (!node)
return 0;
+ /* Detect IOMMU and make sure ACS will be enabled */
+ if (of_property_read_bool(node, "iommu-map"))
+ pci_request_acs();
+
bridge->swizzle_irq = pci_common_swizzle;
bridge->map_irq = of_irq_parse_and_map_pci;