linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach
@ 2017-07-10 19:33 Paul Kocialkowski
  2017-07-11  6:43 ` Mikko Perttunen
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Paul Kocialkowski @ 2017-07-10 19:33 UTC (permalink / raw)
  To: linux-arm-kernel

When there is no device to attach to the IOMMU domain, as may be the
case when the device-tree does not contain the proper iommu node, it is
best to keep going without IOMMU support rather than failing.
This allows the driver to probe and function instead of taking down
all of the tegra drm driver, leading to missing display support.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
---
 drivers/gpu/host1x/dev.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
index ac65f52850a6..f296738d0de8 100644
--- a/drivers/gpu/host1x/dev.c
+++ b/drivers/gpu/host1x/dev.c
@@ -186,8 +186,13 @@ static int host1x_probe(struct platform_device *pdev)
 			return -ENOMEM;
 
 		err = iommu_attach_device(host->domain, &pdev->dev);
-		if (err)
+		if (err == -ENODEV) {
+			iommu_domain_free(host->domain);
+			host->domain = NULL;
+			goto iommu_skip;
+		} else if (err) {
 			goto fail_free_domain;
+		}
 
 		geometry = &host->domain->geometry;
 
@@ -198,6 +203,7 @@ static int host1x_probe(struct platform_device *pdev)
 		host->iova_end = geometry->aperture_end;
 	}
 
+iommu_skip:
 	err = host1x_channel_list_init(host);
 	if (err) {
 		dev_err(&pdev->dev, "failed to initialize channel list\n");
-- 
2.13.1

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

end of thread, other threads:[~2017-07-27 16:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10 19:33 [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Paul Kocialkowski
2017-07-11  6:43 ` Mikko Perttunen
2017-07-18  9:09   ` Jon Hunter
2017-07-11  8:49 ` Paul Kocialkowski
2017-07-11 14:37   ` Marcel Ziswiler
2017-07-11 14:44     ` Paul Kocialkowski
2017-07-11 17:09       ` Mikko Perttunen
2017-07-27 16:45 ` Thierry Reding

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).