public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Marcel Ziswiler <marcel.ziswiler@toradex.com>
To: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"contact@paulk.fr" <contact@paulk.fr>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>
Cc: "jonathanh@nvidia.com" <jonathanh@nvidia.com>,
	"mperttunen@nvidia.com" <mperttunen@nvidia.com>,
	"treding@nvidia.com" <treding@nvidia.com>,
	"swarren@nvidia.com" <swarren@nvidia.com>
Subject: Re: [PATCH] gpu: host1x: Free the IOMMU domain when there is no device to attach
Date: Tue, 11 Jul 2017 14:37:35 +0000	[thread overview]
Message-ID: <1499783851.1520.16.camel@toradex.com> (raw)
In-Reply-To: <1499762987.1340.10.camel@paulk.fr>

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!

  reply	other threads:[~2017-07-11 14:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2017-07-11 14:44     ` Paul Kocialkowski
2017-07-11 17:09       ` Mikko Perttunen
2017-07-27 16:45 ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499783851.1520.16.camel@toradex.com \
    --to=marcel.ziswiler@toradex.com \
    --cc=contact@paulk.fr \
    --cc=jonathanh@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mperttunen@nvidia.com \
    --cc=swarren@nvidia.com \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox