Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1685079
| From | Marcel Ziswiler <marcel.ziswiler@toradex.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach |
| Date | 2017-07-11 16:40 +0200 |
| Message-ID | <u24uu-3uu-15@gated-at.bofh.it> (permalink) |
| References | <u1MHf-HI-5@gated-at.bofh.it> <u1Zbs-8vM-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, 2017-07-11 at 11:49 +0300, Paul Kocialkowski wrote:
> On Mon, 2017-07-10 at 21:33 +0200, Paul Kocialkowski wrote:
> > 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.
>
> Fixes: 404bfb78daf3 ("gpu: host1x: Add IOMMU support")
>
> > Signed-off-by: Paul Kocialkowski <contact-W9ppeneeCTY@public.gmane.
> > org>
> > ---
> > 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");
Please note that this does no longer cleanly apply after Mikko's 'gpu:
host1x: Refactor channel allocation code' commit from June 15 already
applied to current -next. Other than that
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Tested-on: Apalis TK1, Apalis T30, Beaver, Colibri T30, Jetson-TK1
Finally graphics working again, thanks guys!
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Paul Kocialkowski <contact@paulk.fr> - 2017-07-10 21:40 +0200
Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Mikko Perttunen <cyndis@kapsi.fi> - 2017-07-11 08:50 +0200
Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Jon Hunter <jonathanh@nvidia.com> - 2017-07-18 11:20 +0200
Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Paul Kocialkowski <contact@paulk.fr> - 2017-07-11 11:00 +0200
Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Marcel Ziswiler <marcel.ziswiler@toradex.com> - 2017-07-11 16:40 +0200
Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Paul Kocialkowski <contact@paulk.fr> - 2017-07-11 16:50 +0200
Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach Mikko Perttunen <cyndis@kapsi.fi> - 2017-07-11 19:20 +0200
csiph-web