Skip to content

Commit fea2099

Browse files
paulkocialkowskithierryreding
authored andcommitted
gpu: host1x: Free the IOMMU domain when there is no device to attach
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
1 parent b9670ca commit fea2099

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎drivers/gpu/host1x/dev.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,13 @@ static int host1x_probe(struct platform_device *pdev)
186186
return -ENOMEM;
187187

188188
err = iommu_attach_device(host->domain, &pdev->dev);
189-
if (err)
189+
if (err == -ENODEV) {
190+
iommu_domain_free(host->domain);
191+
host->domain = NULL;
192+
goto skip_iommu;
193+
} else if (err) {
190194
goto fail_free_domain;
195+
}
191196

192197
geometry = &host->domain->geometry;
193198

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

206+
skip_iommu:
201207
err = host1x_channel_list_init(&host->channel_list,
202208
host->info->nb_channels);
203209
if (err) {

0 commit comments

Comments
 (0)