Linux Tegra architecture development
 help / color / mirror / Atom feed
From: Mikko Perttunen <cyndis@kapsi.fi>
To: Jason Gunthorpe <jgg@ziepe.ca>, Robin Murphy <robin.murphy@arm.com>
Cc: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>,
	thierry.reding@gmail.com, vdumpa@nvidia.com, joro@8bytes.org,
	will@kernel.org, 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: Tue, 4 Feb 2025 12:26:46 +0900	[thread overview]
Message-ID: <ff901d60-dd54-440f-a0da-4b72052eafd6@kapsi.fi> (raw)
In-Reply-To: <20250203191346.GG2296753@ziepe.ca>

On 2/4/25 4:13 AM, Jason Gunthorpe wrote:
> On Mon, Feb 03, 2025 at 06:49:07PM +0000, Robin Murphy wrote:
>> I'd hope the historical reasons for not supporting IOMMU_DOMAIN_DMA in
>> tegra-smmu no longer apply, given that all the default domain stuff has now
>> been integrated into host1x for the newer arm-smmu based Tegras.
> 
> Indeed I do see appropriate looking calls to the normal DMA API, and
> the other mapping path is conditionalized by !host->domain.
> 
> So, why didn't it work for Diogo? Even in identity mode the DMA API
> will return correct DMA addresses and the !host->domain path will skip
> mapping them.
> 
> Poking around I wonder if there is some assumption that if other parts
> of the stack, maybe the DRM driver, are using the special domain than
> everyone is? It seems to blindly pass around IOVA without really
> checking who is consuming it.

I'm not sure where that would be, but it's certainly possible given that 
this combination of code paths wouldn't have been tested.

> 
> Christian was telling me DMABUF had some drivers that made the
> (incorrect!) assumption they were all sharing translation.
> 
> It does seem like a nice project for someone who has the hardware to
> rip out all of this custom domain stuff and just have the iommu layer
> setup a shared dma-iommu domain.
> 
> Jason
> 

This has been a long-standing project. The issue is that some boot 
chains set up the display expecting identity mappings, but if dma-iommu 
domains were enabled, they would enable the IOMMU without mappings 
before the display driver gets to run. Perhaps Thierry knows what the 
missing pieces are.

See 
https://lore.kernel.org/linux-iommu/20220512190052.1152377-5-thierry.reding@gmail.com/

Cheers,
Mikko

  reply	other threads:[~2025-02-04  4:10 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
2025-02-03 18:49       ` Robin Murphy
2025-02-03 19:13         ` Jason Gunthorpe
2025-02-04  3:26           ` Mikko Perttunen [this message]
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=ff901d60-dd54-440f-a0da-4b72052eafd6@kapsi.fi \
    --to=cyndis@kapsi.fi \
    --cc=baolu.lu@linux.intel.com \
    --cc=diogo.ivo@tecnico.ulisboa.pt \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --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