Skip to content

Commit

Permalink
gpu: host1x: Free the IOMMU domain when there is no device to attach
Browse files Browse the repository at this point in the history
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>
Fixes: 404bfb7 ("gpu: host1x: Add IOMMU support")
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170710193305.5987-1-contact@paulk.fr
  • Loading branch information
Paul Kocialkowski authored and Thierry Reding committed Jul 27, 2017
1 parent b9670ca commit fea2099
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/host1x/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 skip_iommu;
} else if (err) {
goto fail_free_domain;
}

geometry = &host->domain->geometry;

Expand All @@ -198,6 +203,7 @@ static int host1x_probe(struct platform_device *pdev)
host->iova_end = geometry->aperture_end;
}

skip_iommu:
err = host1x_channel_list_init(&host->channel_list,
host->info->nb_channels);
if (err) {
Expand Down

0 comments on commit fea2099

Please sign in to comment.