From: Daniel Vetter <daniel@ffwll.ch>
To: Christoph Hellwig <hch@infradead.org>
Cc: Sean Paul <sean@poorly.run>, Jonathan Marek <jonathan@marek.ca>,
David Airlie <airlied@linux.ie>,
Robin Murphy <robin.murphy@arm.com>,
open list <linux-kernel@vger.kernel.org>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<dri-devel@lists.freedesktop.org>,
iommu@lists.linux-foundation.org, Daniel Vetter <daniel@ffwll.ch>,
"open list:DRM DRIVER FOR MSM ADRENO GPU"
<linux-arm-msm@vger.kernel.org>,
freedreno@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance
Date: Thu, 15 Oct 2020 17:33:34 +0200 [thread overview]
Message-ID: <20201015153334.GF438822@phenom.ffwll.local> (raw)
In-Reply-To: <20201015065532.GA15371@infradead.org>
On Thu, Oct 15, 2020 at 07:55:32AM +0100, Christoph Hellwig wrote:
> On Tue, Oct 13, 2020 at 02:42:38PM +0100, Robin Murphy wrote:
> > I still think this situation would be best handled with a variant of
> > dma_ops_bypass that also guarantees to bypass SWIOTLB, and can be set
> > automatically when attaching to an unmanaged IOMMU domain.
>
> dma_ops_bypass should mostly do the right thing as-is. swiotlb bouncing
> is triggered of two things:
>
> 1) the dma_mask. This is under control of the driver, and obviously
> if it is too small for a legit reason we can't just proceed
Somewhat related, but is there a way to tell the dma-api to fail instead
of falling back to swiotlb? In many case for gpu drivers it's much better
if we fall back to dma_alloc_coherent and manage the copying ourselves
instead of abstracting this away in the dma-api. Currently that's "solved"
rather pessimistically by always allocating from dma_alloc_coherent if
swiotlb could be in the picture (at least for ttm based drivers, i915 just
falls over).
-Daniel
> 2) force_dma_unencrypted() - we'd need to do an opt-out here, either
> by a flag or by being smart and looking for an attached iommu on
> the device
>
> > That way the
> > device driver can make DMA API calls in the appropriate places that do the
> > right thing either way, and only needs logic to decide whether to use the
> > returned DMA addresses directly or ignore them if it knows they're
> > overridden by its own IOMMU mapping.
>
> I'd be happy to review patches for this.
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-10-15 15:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201001002709.21361-1-jonathan@marek.ca>
[not found] ` <20201001002709.21361-3-jonathan@marek.ca>
[not found] ` <20201002075321.GA7547@infradead.org>
[not found] ` <b22fb797-67b0-a912-1d23-2b47c9a9e674@marek.ca>
[not found] ` <20201005082914.GA31702@infradead.org>
[not found] ` <3e0b91be-e4a4-4ea5-7d58-6e71b8d51932@marek.ca>
2020-10-06 7:23 ` [PATCH 2/3] drm/msm: add DRM_MSM_GEM_SYNC_CACHE for non-coherent cache maintenance Christoph Hellwig
2020-10-06 13:19 ` Jonathan Marek
2020-10-07 6:25 ` Christoph Hellwig
2020-10-13 13:42 ` Robin Murphy
2020-10-13 16:11 ` Rob Clark
2020-10-15 6:55 ` Christoph Hellwig
2020-10-15 15:33 ` Daniel Vetter [this message]
2020-10-15 15:43 ` Christoph Hellwig
2020-10-23 6:48 ` Christoph Hellwig
2020-10-08 8:27 ` Joerg Roedel
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=20201015153334.GF438822@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=hch@infradead.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jonathan@marek.ca \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robin.murphy@arm.com \
--cc=sean@poorly.run \
/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;
as well as URLs for NNTP newsgroup(s).