linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Christoph Hellwig <hch@lst.de>,
	Vitaly Kuzmichev <vitaly_kuzmichev@mentor.com>
Cc: gregkh@linuxfoundation.org, m.szyprowski@samsung.com,
	robin.murphy@arm.com, linux-kernel@vger.kernel.org,
	linux-next@vger.kernel.org,
	"George G. Davis" <george_davis@mentor.com>
Subject: Re: [PATCH v2 1/2] drivers: dma-coherent: Fix dev->cma_area vs dev->dma_mem breakage
Date: Fri, 7 Jul 2017 16:40:16 +0100	[thread overview]
Message-ID: <c9677667-e4c1-1384-04e4-e06a962feed9@arm.com> (raw)
In-Reply-To: <20170707142746.GB10818@lst.de>

Christoph,

On 07/07/17 15:27, Christoph Hellwig wrote:
> Vladimir,
> 
> this is why I really didn't like overloading the current
> dma coherent infrastructure with the global pool.
> 
> And this new patch seems like piling hacks over hacks.  I think we
> should go back and make sure allocations from the global coherent
> pool are done by the dma ops implementation, and not before calling
> into them - preferably still reusing the common code for it.
> 
> Vladimir or Vitaly - can you look into that?
> 

It is really sad that Vitaly and George did not join to discussions earlier,
so we could avoid being in situation like this.

Likely I'm missing something, but what should happen if device relies on
dma_contiguous_default_area?

Originally, intention behind dma-default was to simplify things, so instead of 

       reserved-memory {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;

                coherent_dma: linux,dma {
                        compatible = "shared-dma-pool";
                        no-map;
                        reg = <0x78000000 0x800000>;
                };
        };

  
        dev0: dev@12300000 {
                memory-region = <&coherent_dma>;
                /* ... */
        };

        dev1: dev@12500000 {
                memory-region = <&coherent_dma>;
                /* ... */
        };

        dev2: dev@12600000 {
                memory-region = <&coherent_dma>;
                /* ... */
        };

in device tree we could simply have

       reserved-memory {
                #address-cells = <1>;
                #size-cells = <1>;
                ranges;

                coherent_dma: linux,dma {
                        compatible = "shared-dma-pool";
                        no-map;
                        reg = <0x78000000 0x800000>;
                        linux,dma-default;
                };
        };

and that just work in my (NOMMU) case because there is no CMA there...

However, given that dma-default is being overloaded and there are no device
tree users merged yet, I would not object stepping back, reverting "drivers:
dma-coherent: Introduce default DMA pool" and cooperatively rethinking
design/implementation, so every party gets happy. 

The rest of my original patch set should be enough to keep NOMMU working.

Cheers
Vladimir

  reply	other threads:[~2017-07-07 15:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 14:51 [PATCH 0/2] Implement default DMA coherent pool vitaly_kuzmichev
2017-07-03 14:51 ` [PATCH 1/2] drivers: dma-coherent: Add support for " vitaly_kuzmichev
2017-07-04 21:02   ` kbuild test robot
2017-07-05  5:55   ` kbuild test robot
2017-07-10  0:36   ` Rob Herring
2017-07-03 14:51 ` [PATCH 2/2] drivers: dma-coherent: show per-device DMA region utilization via procfs vitaly_kuzmichev
2017-07-07 13:22 ` [PATCH v2 0/2] Additions to default DMA coherent pool Vitaly Kuzmichev
2017-07-07 13:22   ` [PATCH v2 1/2] drivers: dma-coherent: Fix dev->cma_area vs dev->dma_mem breakage Vitaly Kuzmichev
2017-07-07 14:27     ` Christoph Hellwig
2017-07-07 15:40       ` Vladimir Murzin [this message]
2017-07-07 16:06         ` Robin Murphy
2017-07-07 16:44           ` Vladimir Murzin
2017-07-07 17:55             ` Robin Murphy
2017-07-10 13:42               ` Vladimir Murzin
2017-07-11 14:19           ` Christoph Hellwig
2017-07-07 13:23   ` [PATCH v2 2/2] drivers: dma-coherent: show per-device DMA region utilization via procfs Vitaly Kuzmichev
2017-07-07 14:28     ` Christoph Hellwig
2017-07-07 13:55   ` [PATCH v2 0/2] Additions to default DMA coherent pool Stephen Rothwell

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=c9677667-e4c1-1384-04e4-e06a962feed9@arm.com \
    --to=vladimir.murzin@arm.com \
    --cc=george_davis@mentor.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    --cc=vitaly_kuzmichev@mentor.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).