linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Rob Clark <robdclark@chromium.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Kate Stewart <kstewart@linuxfoundation.org>,
	Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>,
	"Maciej W. Rozycki" <macro@linux-mips.org>,
	Eric Biggers <ebiggers@google.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Imre Deak <imre.deak@intel.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Benjamin Gaignard <benjamin.gaignard@linaro.org>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Will Deacon <will@kernel.org>,
	Emil Velikov <emil.velikov@collabora.com>,
	Deepak Sharma <deepak.sharma@amd.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Paul Burton <paul.burton@mips.com>,
	Mike Rapoport <rppt@linux.ibm.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	"moderated list:ARM64 PORT \(AARCH64 ARCHITECTURE\)"
	<linux-arm-kernel@lists.infradead.org>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Robin Murphy <robin.murphy@arm.com>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<linux-arm-msm@vger.kernel.org>, Joerg Roedel <jroedel@suse.de>,
	Arnd Bergmann <arnd@arndb.de>,
	Anshuman Khandual <anshuman.khandual@arm.com>,
	Hauke Mehrtens <hauke@hauke-m.de>,
	Jesper Dangaard Brouer <brouer@redhat.com>,
	"Wolfram Sang \(Renesas\)" <wsa+renesas@sang-engineering.com>,
	"open list:LINUX FOR POWERPC \(32-BIT AND 64-BIT\)"
	<linuxppc-dev@lists.ozlabs.org>,
	Alexios Zavras <alexios.zavras@intel.com>,
	Russell King <rmk+kernel@armlinux.org.uk>,
	Doug Anderson <armlinux@m.disordat.com>,
	Thomas Gleixner <tglx@linutronix.de>, Sean Paul <sean@poorly.run>,
	Allison Randal <allison@lohutok.net>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Enrico Weigelt <info@metux.net>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	open list <linux-kernel@vger.kernel.org>,
	Rob Clark <robdclark@gmail.com>,
	Souptick Joarder <jrdr.linux@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"open list:DRM DRIVER FOR MSM ADRENO GPU"
	<freedreno@lists.freedesktop.org>
Subject: Re: [PATCH 0/6] drm+dma: cache support for arm, etc
Date: Thu, 15 Aug 2019 06:54:39 -0700	[thread overview]
Message-ID: <CAJs_Fx4bS64s7+xQqsead3N80ZQpofqegFQu+tT=b3wcGd_2pA@mail.gmail.com> (raw)
In-Reply-To: <20190815065117.GA23761@lst.de>

On Wed, Aug 14, 2019 at 11:51 PM Christoph Hellwig <hch@lst.de> wrote:
>
> As said before I don't think these low-level helpers are the
> right API to export, but even if they did you'd just cover a tiny
> subset of the architectures.

Are you thinking instead something like:

void dma_sync_sg_for_{cpu,device}(struct device *dev, struct scatterlist *sgl,
                                  int nents, enum dma_data_direction dir)
{
    for_each_sg(sgl, sg, nents, i) {
        arch_sync_dma_for_..(dev, sg_phys(sg), sg->length, dir);
    }
}
EXPORT_SYMBOL_GPL(dma_sync_sg_for_..)

or did you have something else in mind?

I guess something like this would avoid figuring out *which* archs
actually build drm..


> Also to distil the previous thread - if you remap memory to uncached
> the helper to use is arch_dma_prep_coherent, which does a writeback+
> invalidate everywhere, and there is no need to clean up after a
> long-term uncached mapping.  We might still get speculations into
> that area, if we don't remap the direct mapping, but it isn't like
> invalidting that just before freeing the memory is going to help
> anyone.

hmm, IIUC the aarch64 cache instructions, what I'm doing now is equiv
to what I would get with dma_map_sg(DMA_BIDIRECTIONAL) and
arch_dma_prep_coherent() is equiv to what I'd get w/ DMA_FROM_DEVICE
(but a single pass instead of separate inv+clean passes)..

but I can respin this with a single dma_prep_coherent_sg() which uses
arch_dma_prep_coherent()..

> Also it seems like patches 5 and 6 are missing in my inbox.

Hmm, not entirely sure why.. you should be on the cc list for each
individual patch.

But here is the patchwork link if you want to see them:

https://patchwork.freedesktop.org/series/65211/

BR,
-R

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-15 13:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14 21:59 [PATCH 0/6] drm+dma: cache support for arm, etc Rob Clark
2019-08-14 21:59 ` [PATCH 1/6] arm64: export arch_sync_dma_for_*() Rob Clark
2019-08-14 21:59 ` [PATCH 2/6] mips: " Rob Clark
2019-08-14 21:59 ` [PATCH 4/6] arm: add arch_sync_dma_for_*() Rob Clark
2019-08-15  6:51 ` [PATCH 0/6] drm+dma: cache support for arm, etc Christoph Hellwig
2019-08-15 13:54   ` Rob Clark [this message]
2019-08-15 17:53     ` Christoph Hellwig
2019-08-15 18:21       ` Koenig, Christian
2019-08-15 18:27         ` Christoph Hellwig
2019-08-16 21:04       ` Rob Clark
2019-08-19  5:23         ` Christoph Hellwig
2019-08-19 14:39           ` Rob Clark
     [not found] <215e5cb7-0fcf-48db-a656-817054dde420@email.android.com>
2019-08-15 18:52 ` Christoph Hellwig

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='CAJs_Fx4bS64s7+xQqsead3N80ZQpofqegFQu+tT=b3wcGd_2pA@mail.gmail.com' \
    --to=robdclark@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexios.zavras@intel.com \
    --cc=allison@lohutok.net \
    --cc=anshuman.khandual@arm.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=armlinux@m.disordat.com \
    --cc=arnd@arndb.de \
    --cc=benjamin.gaignard@linaro.org \
    --cc=brouer@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=christophe.leroy@c-s.fr \
    --cc=daniel.vetter@ffwll.ch \
    --cc=deepak.sharma@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ebiggers@google.com \
    --cc=emil.velikov@collabora.com \
    --cc=freedreno@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hauke@hauke-m.de \
    --cc=hch@lst.de \
    --cc=imre.deak@intel.com \
    --cc=info@metux.net \
    --cc=jrdr.linux@gmail.com \
    --cc=jroedel@suse.de \
    --cc=kstewart@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=m.mizuma@jp.fujitsu.com \
    --cc=macro@linux-mips.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paul.burton@mips.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robdclark@gmail.com \
    --cc=robin.murphy@arm.com \
    --cc=rppt@linux.ibm.com \
    --cc=sean@poorly.run \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=yamada.masahiro@socionext.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;
as well as URLs for NNTP newsgroup(s).