All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 1/6] iommu: of: Fix check for returning EPROBE_DEFER
@ 2017-05-27 13:47 ` Sricharan R
  0 siblings, 0 replies; 35+ messages in thread
From: Sricharan R @ 2017-05-27 13:47 UTC (permalink / raw)
  To: robin.murphy-5wv7dgnIgG8, will.deacon-5wv7dgnIgG8,
	joro-zLv9SwRftAIdnm+yROfE0A, lorenzo.pieralisi-5wv7dgnIgG8,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ,
	bhelgaas-hpIqsD4AKlfQT0dZR+AlfA,
	linux-pci-u79uwXL29TY76Z2rM5mHXA,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA, tn-nYOzD4b6Jr9Wk0Htik3J/w,
	hanjun.guo-QSEj5FYQhm4dnm+yROfE0A, okaya-sgV2jX0FEOL9JmXXK+q4OQ,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	frowand.list-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, sudeep.holla-5wv7dgnIgG8,
	rjw-LthD3rsA81gm4RdzfppkhA, lenb-DgEjT+Ai2ygdnm+yROfE0A,
	catalin.marinas-5wv7dgnIgG8, arnd-r2nGTMty4D4,
	linux-arch-u79uwXL29TY76Z2rM5mHXA,
	laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw,
	j.neuschaefer-hi6Y0CQ0nG0, geert-Td1EMuHUCqxL1ZNQvxDV9g,
	magnus.damm-Re5JQEeQqe8AvxtiuMwx3w,
	nwatters-sgV2jX0FEOL9JmXXK+q4OQ, linux-I+IVW8TIWO2tmTQ+vhA3Yw

Now with IOMMU probe deferral, we return -EPROBE_DEFER
for masters that are connected to an IOMMU which is not
probed yet, but going to get probed, so that we can attach
the correct dma_ops. So while trying to defer the probe of
the master, check if the of_iommu node that it is connected
to is marked in DT as 'status=disabled', then the IOMMU is never
is going to get probed. So simply return NULL and let the master
work without an IOMMU.

Fixes: 7b07cbefb68d ("iommu: of: Handle IOMMU lookup failure with deferred probing or error")
Reported-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Tested-by: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Tested-by: Magnus Damn <magnus.damn-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Acked-by: Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>
Signed-off-by: Sricharan R <sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
---
 drivers/iommu/of_iommu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
index 9f44ee8..e6e9bec 100644
--- a/drivers/iommu/of_iommu.c
+++ b/drivers/iommu/of_iommu.c
@@ -118,6 +118,7 @@ static bool of_iommu_driver_present(struct device_node *np)
 
 	ops = iommu_ops_from_fwnode(fwnode);
 	if ((ops && !ops->of_xlate) ||
+	    !of_device_is_available(iommu_spec->np) ||
 	    (!ops && !of_iommu_driver_present(iommu_spec->np)))
 		return NULL;
 
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation

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

end of thread, other threads:[~2017-05-30  9:32 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27 13:47 [PATCH v6 1/6] iommu: of: Fix check for returning EPROBE_DEFER Sricharan R
2017-05-27 13:47 ` Sricharan R
2017-05-27 13:47 ` Sricharan R
2017-05-27 13:47 ` Sricharan R
     [not found] ` <1495892865-9506-1-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-05-27 13:47   ` [PATCH v6 2/6] iommu: of: Ignore all errors except EPROBE_DEFER Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47   ` [PATCH v6 3/6] ACPI/IORT: " Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
     [not found]     ` <1495892865-9506-3-git-send-email-sricharan-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-05-27 19:18       ` Rafael J. Wysocki
2017-05-27 19:18         ` Rafael J. Wysocki
2017-05-27 19:18         ` Rafael J. Wysocki
2017-05-29  5:06         ` Sricharan R
2017-05-29  5:06           ` Sricharan R
2017-05-30  9:06           ` Lorenzo Pieralisi
2017-05-30  9:06             ` Lorenzo Pieralisi
2017-05-27 13:47   ` [PATCH v6 4/6] ARM: dma-mapping: Don't tear down third-party mappings Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47   ` [PATCH v6 5/6] ACPI/IORT: Move the check to get iommu_ops from translated fwspec Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47   ` [PATCH v6 6/6] arm: dma-mapping: Reset the device's dma_ops Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-27 13:47     ` Sricharan R
2017-05-30  9:32   ` [PATCH v6 1/6] iommu: of: Fix check for returning EPROBE_DEFER Joerg Roedel
2017-05-30  9:32     ` Joerg Roedel
2017-05-30  9:32     ` Joerg Roedel
2017-05-30  9:32     ` Joerg Roedel

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.