Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1414610

[PATCH v2 06/11] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus

From Magnus Damm <magnus.damm@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 06/11] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus
Date 2016-06-06 06:10 +0200
Message-ID <rGU1s-8cc-29@gated-at.bofh.it> (permalink)
References <rGU1r-8cc-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

The ->xlate() call gets invoked even though the iommu
device has status = "disabled" in DT, so make sure we
skip over disabled devices.

In my mind it would make sense to have this at some
shared level, but I guess some users may want to
configure the iommu regardless of DT state.

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

 Changes since V1:
 - Reworked slightly to fit on top of updated patch order

 drivers/iommu/ipmmu-vmsa.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- 0017/drivers/iommu/ipmmu-vmsa.c
+++ work/drivers/iommu/ipmmu-vmsa.c	2016-06-06 10:58:18.530607110 +0900
@@ -1001,7 +1001,13 @@ static struct iommu_group *ipmmu_device_
 static int ipmmu_of_xlate_dma(struct device *dev,
 			      struct of_phandle_args *spec)
 {
-	/* dummy callback to satisfy of_iommu_configure() */
+	/* If the IPMMU device is disabled in DT then return error
+	 * to make sure the of_iommu code does not install ops
+	 * even though the iommu device is disabled
+	 */
+	if (!of_device_is_available(spec->np))
+		return -ENODEV;
+
 	return 0;
 }
 

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 06/11] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Magnus Damm <magnus.damm@gmail.com> - 2016-06-06 06:10 +0200
  Re: [PATCH v2 06/11] iommu/ipmmu-vmsa: Teach xlate() to skip disabled iommus Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2016-06-08 02:30 +0200

csiph-web