devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Laura Abbott <lauraa@codeaurora.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linaro-mm-sig@lists.linaro.org, devicetree@vger.kernel.org,
	Arnd Bergmann <arnd@arndb.de>,
	Michal Nazarewicz <mina86@mina86.com>,
	Grant Likely <grant.likely@linaro.org>,
	Tomasz Figa <t.figa@samsung.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Nishanth Peethambaran <nishanth.p@gmail.com>,
	Marc <marc.ceeeee@gmail.com>,
	Josh Cartwright <joshc@codeaurora.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Paul Mackerras <paulus@samba.org>, Jon Medhurst <tixy@linaro.org>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	"Aneesh Kumar K.V." <aneesh.kumar@linux.vnet.ibm.com>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2 0/4] CMA & device tree, once again
Date: Tue, 26 Aug 2014 15:00:28 +0200	[thread overview]
Message-ID: <53FC84EC.1050800@samsung.com> (raw)
In-Reply-To: <53E56B16.5030402@codeaurora.org>

Hello,

On 2014-08-09 02:28, Laura Abbott wrote:
> On 7/14/2014 12:12 AM, Marek Szyprowski wrote:
>> Hello,
>>
>> This is one more respin of the patches which add support for creating
>> reserved memory regions defined in device tree. The last attempt
>> (http://lists.linaro.org/pipermail/linaro-mm-sig/2014-February/003738.html)
>> ended in merging only half of the code, so right now we have complete
>> documentation merged and only basic code, which implements a half of it
>> is written in the documentation. Although the merged patches allow to
>> reserve memory, there is no way of using it for devices and drivers.
>>
>> This situation makes CMA rather useless, as the main architecture (ARM),
>> which used it, has been converted from board-file based system
>> initialization to device tree. Thus there is no place to use direct
>> calls to dma_declare_contiguous() and some new solution, which bases on
>> device tree, is urgently needed.
>>
>> This patch series fixes this issue. It provides two, already widely
>> discussed and already present in the kernel, drivers for reserved
>> memory: first based on DMA-coherent allocator, second using Contiguous
>> Memory Allocator. The first one nicely implements typical 'carved out'
>> reserved memory way of allocating contiguous buffers in a kernel-style
>> way. The memory is used exclusively by devices assigned to the given
>> memory region. The second one allows to reuse reserved memory for
>> movable kernel pages (like disk buffers, anonymous memory) and migrates
>> it out when device to allocates contiguous memory buffer. Both driver
>> provides memory buffers via standard dma-mapping API.
>>
>> The patches have been rebased on top of latest CMA and mm changes merged
>> to akmp kernel tree.
>>
>> To define a 64MiB CMA region following node is needed:
>>
>> multimedia_reserved: multimedia_mem_region {
>> 	compatible = "shared-dma-pool";
>> 	reusable;
>> 	size = <0x4000000>;
>> 	alignment = <0x400000>;
>> };
>>
>> Similarly, one can define 64MiB region with DMA coherent memory:
>>
>> multimedia_reserved: multimedia_mem_region {
>> 	compatible = "shared-dma-pool";
>> 	no-map;
>> 	size = <0x4000000>;
>> 	alignment = <0x400000>;
>> };
>>
> Longer term, I think it would be good if we didn't have to use no-map with
> the coherent memory. With no-map and dma-coherent.c right now, not only
> do you lose out on the physical memory space, you also have to give up
> the same amount of vmalloc space for mapping. On arm32, if you have the default
> 240MB vmalloc space, 64M is ~25% of the vmalloc space. At least on arm you can
> make this up by remapping the memory as coherent.
>
> I haven't seen this picked up anywhere yet so you are welcome to add
>
> Tested-by: Laura Abbott <lauraa@codeaurora.org>

Right, when the code reaches mainline I will add code which will remove 
no-map
requirement. Changing memory attributes can be handled in this case the same
way as for CMA.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

      reply	other threads:[~2014-08-26 13:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14  7:12 [PATCH v2 0/4] CMA & device tree, once again Marek Szyprowski
     [not found] ` <1405321966-28184-1-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-07-14  7:12   ` [PATCH v2 1/4] drivers: of: add automated assignment of reserved regions to client devices Marek Szyprowski
2014-07-14  7:12   ` [PATCH v2 2/4] drivers: of: initialize and assign reserved memory to newly created devices Marek Szyprowski
2014-07-14  7:12   ` [PATCH v2 3/4] drivers: dma-coherent: add initialization from device tree Marek Szyprowski
     [not found]     ` <1405321966-28184-4-git-send-email-m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-08-09  0:25       ` Laura Abbott
2014-07-14  7:12   ` [PATCH v2 4/4] drivers: dma-contiguous: " Marek Szyprowski
2014-08-08 23:53     ` Laura Abbott
2014-08-09  0:28   ` [PATCH v2 0/4] CMA & device tree, once again Laura Abbott
2014-08-26 13:00     ` Marek Szyprowski [this message]

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=53FC84EC.1050800@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=grant.likely@linaro.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=joshc@codeaurora.org \
    --cc=lauraa@codeaurora.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.ceeeee@gmail.com \
    --cc=mina86@mina86.com \
    --cc=nishanth.p@gmail.com \
    --cc=paulus@samba.org \
    --cc=s.hauer@pengutronix.de \
    --cc=t.figa@samsung.com \
    --cc=tixy@linaro.org \
    --cc=will.deacon@arm.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).