All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] iommu/ipmmu-vmsa: Update ->add_device() return value
@ 2016-09-20 12:41 ` Magnus Damm
  0 siblings, 0 replies; 6+ messages in thread
From: Magnus Damm @ 2016-09-20 12:41 UTC (permalink / raw)
  To: iommu
  Cc: linux-renesas-soc, Magnus Damm, laurent.pinchart+renesas, joro,
	geert+renesas

From: Magnus Damm <damm+renesas@opensource.se>

Update the IPMMU driver to return -ENODEV when adding devices
not hooked up a particular IPMMU instance.

Currently the ->add_device() callback implementation in the IPMMU
driver returns -ENODEV for devices with no "iommus" property,
however the function ipmmu_find_utlbs() may return -EINVAL.

This patch updates the ipmmu_find_utlbs() return value to -ENODEV
for the case when multiple IPMMU instances exist. That way the
code matches the expected behaviour described in the comment of
the add_iommu_group() function in iommu.c:

 /*
  * We ignore -ENODEV errors for now, as they just mean that the
  * device is not translated by an IOMMU. We still care about
  * other errors and fail to initialize when they happen.
  */

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
---

 Applies to next-20160920 on top of:
 b1e2afc iommu/ipmmu-vmsa: Fix wrong error handle of ipmmu_add_device

 drivers/iommu/ipmmu-vmsa.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 0002/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2016-09-08 18:20:06.270607110 +0900
@@ -781,7 +781,7 @@ static int ipmmu_find_utlbs(struct ipmmu
 		of_node_put(args.np);
 
 		if (args.np != mmu->dev->of_node || args.args_count != 1)
-			return -EINVAL;
+			return -ENODEV;
 
 		utlbs[i] = args.args[0];
 	}

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-22 15:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-20 12:41 [PATCH/RFC] iommu/ipmmu-vmsa: Update ->add_device() return value Magnus Damm
2016-09-20 12:41 ` Magnus Damm
2016-09-20 13:18 ` Robin Murphy
2016-09-20 13:18   ` Robin Murphy
2016-09-20 15:03   ` Magnus Damm
2016-09-22 15:56     ` Robin Murphy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.