iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Anastasio via iommu <iommu@lists.linux-foundation.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Sam Bobroff <sbobroff@linux.ibm.com>,
	iommu@lists.linux-foundation.org,
	Oliver O'Halloran <oohall@gmail.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] powerpc/dma: Fix invalid DMA mmap behavior
Date: Fri, 19 Jul 2019 02:36:42 -0500	[thread overview]
Message-ID: <3dd3bf62-3881-51f1-bbb0-e8ee515bb3d8@anastas.io> (raw)
In-Reply-To: <20190719070659.GA19555@lst.de>

On 7/19/19 2:06 AM, Christoph Hellwig wrote:
 > What is inherently architecture specific here over the fact that
 > the pgprot_* expand to architecture specific bits?

What I meant is that different architectures seem to have different
criteria for setting the different pgprot_ bits. i.e. ppc checks
for cache coherency, arm64 checks for cache coherency and
writecombine, mips just checks for writecombine, etc.

That being said, I'm no expert here and there is probably some behavior
here that would make for a much more sane default.

 > I'd rather not create boilerplate code where we don't have to it. Note
 > that arch_dma_mmap_pgprot is a little misnamed now, as we also use it
 > for the in-kernel remapping in kernel/dma/remap.c, which I'm slowly
 > switching a lot of architectures to.  powerpc will follow soon once
 > I get the ppc44x that was given to me to actually boot with a recent
 > kernel (not that I've tried much so far).

Fair enough. I didn't realize that most of the other architectures
don't use the common code anyways as you mention below.

 > Every arch except for arm32 now uses dma direct for the direct mapping,
 > and thus the common code without the indeed odd default.  I also have
 > a series to remove the default fallback, which is inherently a bad idea:
 >
 > 
http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/dma-no-defaults

Awesome. This is great to hear.

 > I think your patch that started this thread is fine for 5.3 and -stable:
 >
 > Reviewed-by: Christoph Hellwig <hch@lst.de>

Thanks!

 > But going forward I'd rather have a sane default.

Agreed.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2019-07-19  7:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190717235437.12908-1-shawn@anastas.io>
     [not found] ` <8b6963ac-521a-5752-2cfb-bcd87cad9dc4@ozlabs.ru>
     [not found]   ` <f9753335-b62c-67b4-84d7-7b67fe1b64ca@anastas.io>
     [not found]     ` <CAOSf1CGA_fDH7aAqRkc4maJUByaX7adGcjyt3cj4KFsMJNnocA@mail.gmail.com>
     [not found]       ` <20190718084934.GF24562@lst.de>
2019-07-18  9:52         ` [PATCH] powerpc/dma: Fix invalid DMA mmap behavior Christoph Hellwig
2019-07-18 19:46           ` Shawn Anastasio via iommu
2019-07-19  7:06             ` Christoph Hellwig
2019-07-19  7:36               ` Shawn Anastasio via iommu [this message]
2019-07-19 11:18           ` Arnd Bergmann
2019-07-22 12:16             ` Michael Ellerman
2019-07-22 19:23               ` Shawn Anastasio via iommu
2019-07-22 23:09                 ` Michael Ellerman

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=3dd3bf62-3881-51f1-bbb0-e8ee515bb3d8@anastas.io \
    --to=iommu@lists.linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    --cc=sbobroff@linux.ibm.com \
    --cc=shawn@anastas.io \
    /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).