Skip to content

Commit fb709b5

Browse files
Jean-Philippe Bruckermstsirkin
authored andcommitted
of: Allow the iommu-map property to omit untranslated devices
In PCI root complex nodes, the iommu-map property describes the IOMMU that translates each endpoint. On some platforms, the IOMMU itself is presented as a PCI endpoint (e.g. AMD IOMMU and virtio-iommu). This isn't supported by the current OF driver, which expects all endpoints to have an IOMMU. Allow the iommu-map property to have gaps. Relaxing of_map_rid() also allows the msi-map property to have gaps, which is invalid since MSIs always reach an MSI controller. In that case pci_msi_setup_msi_irqs() will return an error when attempting to find the device's MSI domain. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Jean-Philippe Brucker <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 6c9e92e commit fb709b5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/of/base.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,8 +2294,12 @@ int of_map_rid(struct device_node *np, u32 rid,
22942294
return 0;
22952295
}
22962296

2297-
pr_err("%pOF: Invalid %s translation - no match for rid 0x%x on %pOF\n",
2298-
np, map_name, rid, target && *target ? *target : NULL);
2299-
return -EFAULT;
2297+
pr_info("%pOF: no %s translation for rid 0x%x on %pOF\n", np, map_name,
2298+
rid, target && *target ? *target : NULL);
2299+
2300+
/* Bypasses translation */
2301+
if (id_out)
2302+
*id_out = rid;
2303+
return 0;
23002304
}
23012305
EXPORT_SYMBOL_GPL(of_map_rid);

0 commit comments

Comments
 (0)