diff options
author | Robin Murphy <robin.murphy@arm.com> | 2017-08-04 19:29:06 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2017-08-15 19:23:50 +0300 |
commit | da4b02750a9fe1d1c4d047d14e69ec7542dddeb3 (patch) | |
tree | 43e25970cff5299f2e3c8139c300936de1d426ae /drivers/iommu/mtk_iommu.c | |
parent | 05f80300dc8bcfe8566b36256d01482cae5afa02 (diff) | |
download | linux-da4b02750a9fe1d1c4d047d14e69ec7542dddeb3.tar.xz |
iommu/of: Fix of_iommu_configure() for disabled IOMMUs
Sudeep reports that the logic got slightly broken when a PCI iommu-map
entry targets an IOMMU marked as disabled in DT, since of_pci_map_rid()
succeeds in following a phandle, and of_iommu_xlate() doesn't return an
error value, but we miss checking whether ops was actually non-NULL.
Whilst this could be solved with a point fix in of_pci_iommu_init(), it
suggests that all the juggling of ERR_PTR values through the ops pointer
is proving rather too complicated for its own good, so let's instead
simplify the whole flow (with a side-effect of eliminating the cause of
the bug).
The fact that we now rely on iommu_fwspec means that we no longer need
to pass around an iommu_ops pointer at all - we can simply propagate a
regular int return value until we know whether we have a viable IOMMU,
then retrieve the ops from the fwspec if and when we actually need them.
This makes everything a bit more uniform and certainly easier to follow.
Fixes: d87beb749281 ("iommu/of: Handle PCI aliases properly")
Reported-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/mtk_iommu.c')
0 files changed, 0 insertions, 0 deletions