From: Jason Gunthorpe <jgg@ziepe.ca>
To: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Cc: thierry.reding@gmail.com, vdumpa@nvidia.com, joro@8bytes.org,
will@kernel.org, robin.murphy@arm.com, jonathanh@nvidia.com,
baolu.lu@linux.intel.com, jsnitsel@redhat.com, jroedel@suse.de,
regressions@lists.linux.dev, linux-tegra@vger.kernel.org,
iommu@lists.linux.dev
Subject: Re: [REGRESSION] Invalid gather when using Tegra210 media engines
Date: Mon, 3 Feb 2025 13:43:31 -0400 [thread overview]
Message-ID: <20250203174331.GF2296753@ziepe.ca> (raw)
In-Reply-To: <4ea1a48c-9020-4793-ac9b-b51fc289e442@tecnico.ulisboa.pt>
> > How about this:
> >
> > diff --git a/drivers/gpu/host1x/dev.c b/drivers/gpu/host1x/dev.c
> > index be2ad7203d7b96..090b1fc97a7309 100644
> > --- a/drivers/gpu/host1x/dev.c
> > +++ b/drivers/gpu/host1x/dev.c
> > @@ -361,6 +361,10 @@ static bool host1x_wants_iommu(struct host1x *host1x)
> > return true;
> > }
> > +/*
> > + * Returns ERR_PTR on failure, NULL if the translation is IDENTITY, otherwise a
> > + * valid paging domain.
> > + */
> > static struct iommu_domain *host1x_iommu_attach(struct host1x *host)
> > {
> > struct iommu_domain *domain = iommu_get_domain_for_dev(host->dev);
> > @@ -385,6 +389,8 @@ static struct iommu_domain *host1x_iommu_attach(struct host1x *host)
> > * Similarly, if host1x is already attached to an IOMMU (via the DMA
> > * API), don't try to attach again.
> > */
> > + if (domain && domain->type == IOMMU_DOMAIN_IDENTITY)
> > + domain = NULL;
> > if (!host1x_wants_iommu(host) || domain)
> > return domain;
> >
> > (if not can you investigate this function's flow compared to a good
> > kernel?)
>
> Yes, this worked! Does this mean that with this change we go through the
> path of using the shared Tegra domain (for example in the driver I
> attached client->group == true), and if that is the case would it be
> beneficial for us to try and change tegra_smmu_def_domain_type() from
> returning IOMMU_DOMAIN_IDENTITY into IOMMU_DOMAIN_DMA so that the
> dma_alloc_* functions are called directly?
I do not know the answer those questions.. The whole rational around
this host 1x domain stuff is mysterious to me.
It does sound quite appealing for the implementation to use the dma
api instead of attaching its own special domain.
Jason
next prev parent reply other threads:[~2025-02-03 17:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 14:55 [REGRESSION] Invalid gather when using Tegra210 media engines Diogo Ivo
2025-02-03 17:06 ` Jason Gunthorpe
2025-02-03 17:35 ` Diogo Ivo
2025-02-03 17:43 ` Jason Gunthorpe [this message]
2025-02-03 18:49 ` Robin Murphy
2025-02-03 19:13 ` Jason Gunthorpe
2025-02-04 3:26 ` Mikko Perttunen
2025-02-04 13:21 ` Jason Gunthorpe
2025-02-04 14:36 ` 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=20250203174331.GF2296753@ziepe.ca \
--to=jgg@ziepe.ca \
--cc=baolu.lu@linux.intel.com \
--cc=diogo.ivo@tecnico.ulisboa.pt \
--cc=iommu@lists.linux.dev \
--cc=jonathanh@nvidia.com \
--cc=joro@8bytes.org \
--cc=jroedel@suse.de \
--cc=jsnitsel@redhat.com \
--cc=linux-tegra@vger.kernel.org \
--cc=regressions@lists.linux.dev \
--cc=robin.murphy@arm.com \
--cc=thierry.reding@gmail.com \
--cc=vdumpa@nvidia.com \
--cc=will@kernel.org \
/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