linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/2] Device Tree support for CMA (Contiguous Memory Allocator)
Date: Fri, 15 Feb 2013 10:24:35 -0600	[thread overview]
Message-ID: <511E6143.609@gmail.com> (raw)
In-Reply-To: <20130215083304.GK1906@pengutronix.de>

On 02/15/2013 02:33 AM, Sascha Hauer wrote:
> On Thu, Feb 14, 2013 at 11:08:54PM +0100, Sylwester Nawrocki wrote:
>> Hi,
>>
>> On 02/14/2013 10:30 PM, Sascha Hauer wrote:
>>> On Thu, Feb 14, 2013 at 01:45:26PM +0100, Marek Szyprowski wrote:
>> ...
>>>> Here is my initial proposal for device tree integration for Contiguous
>>>> Memory Allocator. The code is quite straightforward, however I expect
>>>> that the memory bindings require some discussion.
>>>>
>>>> The proposed bindings allows to define contiguous memory regions of
>>>> specified base address and size. Then, the defined regions can be
>>>> assigned to the given device(s) by adding a property with a phanle to
>>>> the defined contiguous memory region. From the device tree perspective
>>>> that's all. Once the bindings are added, all the memory allocations from
>>>> dma-mapping subsystem will be served from the defined contiguous memory
>>>> regions.
>>>>
>>>
>>> I think CMA regions should not be described in the devicetre at all. The
>>> devicetree is about hardware description and it should be OS agnostic,
>>> but CMA is only a Linux specific implementation detail. It's not even
>>> specific to a particular board, it's specific to a particular usecase of
>>> a board.
>>
>> I disagree. For example, in a multiprocessor system describing the memory
>> regions this way allows to assign memory to each subsystem, e.g. shared
>> memory, so that the memory region constraints are satisfied.
>>
>> CMA just happens to be an implementation of a method of assigning memory
>> to each device in Linux. The constraints on the memory are real hardware
>> constraints, resulting from a particular subsystem architecture.
> 
> If you are talking about DMA controllers which can only access a certain
> memory area, then yes, that's a hardware constraint, I'm not sure though
> if describing this as CMA in the devicetree is the way to go.
> 
> If you are talking about 'on this board I want to have 128MiB for this
> device because I'm doing 1080p while on another board 64MiB are enough
> because I'm doing 720p', then this is not a hardware constraint.
> 
> There may be valid scenarios for putting CMA into the devicetrees, but
> doing this also opens the door for abuse of this binding. I for once
> don't want to find areas being allocated for CMA in the devicetree for
> devices I don't care about. I know I can always exchange a devicetree,
> but I think the devicetree should be seen as firmware to a certain
> degree.

I agree this does not belong in DT. As a kernel developer, the DT comes
from firmware. Can the firmware author decide how much CMA memory is
needed? I don't think so.

I would suggest a kernel command line parameter instead if that does not
already exist.

Rob

  reply	other threads:[~2013-02-15 16:24 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 12:45 [PATCH 0/2] Device Tree support for CMA (Contiguous Memory Allocator) Marek Szyprowski
2013-02-14 12:45 ` [PATCH 1/2] drivers: dma-contiguous: clean source code and prepare for device tree Marek Szyprowski
2013-02-14 21:37   ` Laura Abbott
2013-02-14 12:45 ` [PATCH 2/2] drivers: dma-contiguous: add initialization from " Marek Szyprowski
2013-02-14 21:34   ` [Linaro-mm-sig] " Laura Abbott
2013-02-15 16:12     ` Nishanth Peethambaran
2013-03-15 15:21     ` Marek Szyprowski
2013-03-19 17:54       ` Laura Abbott
2013-02-14 21:30 ` [PATCH 0/2] Device Tree support for CMA (Contiguous Memory Allocator) Sascha Hauer
2013-02-14 22:08   ` Sylwester Nawrocki
2013-02-15  8:33     ` Sascha Hauer
2013-02-15 16:24       ` Rob Herring [this message]
2013-02-17  5:18         ` [Linaro-mm-sig] " Nishanth Peethambaran
2013-02-18 21:58           ` Rob Herring
2013-02-19  9:29             ` Nishanth Peethambaran
2013-02-18 22:25       ` Sylwester Nawrocki
2013-02-19  5:03         ` Olof Johansson
2013-03-15 15:05   ` Marek Szyprowski

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=511E6143.609@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).