linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: dma-mapping: move consistent_init to early_initcall
Date: Fri, 17 Dec 2010 09:48:18 +0000	[thread overview]
Message-ID: <20101217094818.GA9937@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <8c67e174d807416f0c6c190cc72d3f5a.squirrel@www.codeaurora.org>

On Thu, Dec 16, 2010 at 06:55:06PM -0800, Saravana Kannan wrote:
> 
> > On 12 December 2010 04:58, Saravana Kannan <skannan@codeaurora.org> wrote:
> >> As you and James suggested, having the NS bit set by the secure world is
> >> definitely a solution that would work. But IMHO, the explicit cache
> >> flush/invalidate approach keeps the design simple and easy to maintain.
> >
> > That is indeed an approach to the problem. But it depends on whether
> > we consider the DMA API appropriate for this. We can view the secure
> > world as a non-coherent agent accessing the memory and could try to
> > justify the use of the DMA API in Linux.
> >
> > At some point we'll probably have platforms supporting cacheable DMA
> > (e.g. via the ARM coherency port) and the DMA API would no longer give
> > you what you need. But it is also possible that platforms with ACP
> > would only have 1 or 2 devices on that port (some HD LCD controller
> > for example) and the rest of devices non-coherent. In this case, we
> > need to have different DMA operations depending on the bus/device (via
> > get_dma_ops) and thus we can allow your scenario via dedicated DMA
> > ops.
> 
> Catalin,
> 
> Looks like you agree with our approach. If that's the case, would you mind
> Acking Jeff's initial patch that this thread is based on?

I read Catalin's reply as agreeing with me.

> Russell,
> 
> Does Catalin's proposal sound acceptable to you?

Catalin's proposal for get_dma_ops doesn't work for you because you
don't have a struct device for your CPUs - and as we don't have anything
supporting ACP at the moment, there's little point engineering it in.

The basic point here is that using the DMA API to achieve DMA coherency
with something that is not DMA is going to be prone to failure, because
we aren't going to guarantee that it'll do what you want.  There's
already a history of people abusing the DMA API, and then when we fix
stuff in the DMA API, they complain that their drivers have broken.

What I've been saying is never use it for its properties (for its uncached
memory) as that is _not_ guaranteed - use it for its purpose instead
(which is to provide coherent memory for DMA devices) which is guaranteed.

  reply	other threads:[~2010-12-17  9:48 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-02 22:11 [PATCH] arm: dma-mapping: move consistent_init to early_initcall Jeff Ohlstein
2010-12-02 22:19 ` Russell King - ARM Linux
2010-12-03 20:06   ` Saravana Kannan
2010-12-03 20:36     ` Russell King - ARM Linux
2010-12-03 22:45       ` Jamie Iles
2010-12-07  6:22       ` Saravana Kannan
2010-12-09  9:23         ` skannan at codeaurora.org
2010-12-09 10:38           ` Russell King - ARM Linux
2010-12-10  0:58             ` Saravana Kannan
2010-12-10 10:00               ` Catalin Marinas
2010-12-12  4:58                 ` Saravana Kannan
2010-12-13 15:26                   ` Catalin Marinas
2010-12-17  2:55                     ` Saravana Kannan
2010-12-17  9:48                       ` Russell King - ARM Linux [this message]
2010-12-17 10:26                         ` Saravana Kannan
2010-12-17 10:56                           ` Russell King - ARM Linux
2010-12-17 11:09                             ` Saravana Kannan
2010-12-17 11:31                           ` Catalin Marinas
2010-12-17 23:14                             ` Saravana Kannan
2010-12-20 23:22                               ` Saravana Kannan

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=20101217094818.GA9937@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).