All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Laura Abbott <lauraa@codeaurora.org>
Cc: linaro-mm-sig@lists.linaro.org,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	Russell King <linux@arm.linux.org.uk>,
	vgandhi@codeaurora.org
Subject: Re: [RFC] Using CMA with devicetree generated devices
Date: Mon, 29 Oct 2012 15:09:18 +0100	[thread overview]
Message-ID: <508E8E0E.8000605@samsung.com> (raw)
In-Reply-To: <508AFA78.4080602@codeaurora.org>

Hello,

On 10/26/2012 11:02 PM, Laura Abbott wrote:
> Is it possible to use the devices generated from device tree for use
> with CMA? The API for reserving a CMA region (dma_declare_contiguous)
> requires a device pointer to properly associate a region with a device.
> By the time the devices from devicetree are actually available
> (generally during machine_init), dma_contiguous_remap has already been
> called so it's too late to have a properly setup region.
>
> I currently see several options:
>
> 1) All CMA devices must be statically declared in the board file
> 2) Scan the FDT to set up 'dummy' devices early which can later be used
> to set up CMA with the 'proper' devices
> 3) My assumption is completely wrong and the check that I was using is
> invalid:

dma_declare_contiguous() must be called very early, before any dynamic 
structures has been created and before core memory management subsystem 
has been set up. IMHO it should be possible to add support for DT 
directly in drivers/base/dma-contiguous.c. CMA code can iterate over DT 
nodes to initialize its internal structures and then use them once the 
DT devices are being probed/set-up.

> (...)

> I'm currently leaning towards setting up #2 unless I'm missing something
> obvious here. Thanks.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center

WARNING: multiple messages have this Message-ID (diff)
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] Using CMA with devicetree generated devices
Date: Mon, 29 Oct 2012 15:09:18 +0100	[thread overview]
Message-ID: <508E8E0E.8000605@samsung.com> (raw)
In-Reply-To: <508AFA78.4080602@codeaurora.org>

Hello,

On 10/26/2012 11:02 PM, Laura Abbott wrote:
> Is it possible to use the devices generated from device tree for use
> with CMA? The API for reserving a CMA region (dma_declare_contiguous)
> requires a device pointer to properly associate a region with a device.
> By the time the devices from devicetree are actually available
> (generally during machine_init), dma_contiguous_remap has already been
> called so it's too late to have a properly setup region.
>
> I currently see several options:
>
> 1) All CMA devices must be statically declared in the board file
> 2) Scan the FDT to set up 'dummy' devices early which can later be used
> to set up CMA with the 'proper' devices
> 3) My assumption is completely wrong and the check that I was using is
> invalid:

dma_declare_contiguous() must be called very early, before any dynamic 
structures has been created and before core memory management subsystem 
has been set up. IMHO it should be possible to add support for DT 
directly in drivers/base/dma-contiguous.c. CMA code can iterate over DT 
nodes to initialize its internal structures and then use them once the 
DT devices are being probed/set-up.

> (...)

> I'm currently leaning towards setting up #2 unless I'm missing something
> obvious here. Thanks.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center

  reply	other threads:[~2012-10-29 14:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-26 21:02 [RFC] Using CMA with devicetree generated devices Laura Abbott
2012-10-26 21:02 ` Laura Abbott
2012-10-29 14:09 ` Marek Szyprowski [this message]
2012-10-29 14:09   ` 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=508E8E0E.8000605@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=lauraa@codeaurora.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=vgandhi@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.