Skip to content

Commit

Permalink
of: Allow the iommu-map property to omit untranslated devices
Browse files Browse the repository at this point in the history
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 <robh@kernel.org>
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Jean-Philippe Brucker authored and Michael S. Tsirkin committed Jun 6, 2019
1 parent 6c9e92e commit fb709b5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/of/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -2294,8 +2294,12 @@ int of_map_rid(struct device_node *np, u32 rid,
return 0;
}

pr_err("%pOF: Invalid %s translation - no match for rid 0x%x on %pOF\n",
np, map_name, rid, target && *target ? *target : NULL);
return -EFAULT;
pr_info("%pOF: no %s translation for rid 0x%x on %pOF\n", np, map_name,
rid, target && *target ? *target : NULL);

/* Bypasses translation */
if (id_out)
*id_out = rid;
return 0;
}
EXPORT_SYMBOL_GPL(of_map_rid);

0 comments on commit fb709b5

Please sign in to comment.