linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bob Liu <lliubbo@gmail.com>
To: James Bottomley <James.Bottomley@hansenpartnership.com>
Cc: Tony Prisk <linux@prisktech.co.nz>, Mel Gorman <mgorman@suse.de>,
	linux-mm@kvack.org,
	Arm Kernel Mailing List <linux-arm-kernel@lists.infradead.org>,
	Arnd Bergmann <arnd@arndb.de>
Subject: Re: dma_alloc_coherent fails in framebuffer
Date: Wed, 17 Oct 2012 10:26:07 +0800	[thread overview]
Message-ID: <CAA_GA1d_twVqv9jOGx74wvYiuJwQQDAN-NJB_x61df=--yP6Og@mail.gmail.com> (raw)
In-Reply-To: <1350398501.2532.12.camel@dabdike>

On Tue, Oct 16, 2012 at 10:41 PM, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
> On Tue, 2012-10-16 at 10:17 +0800, Bob Liu wrote:
>> I think you need to declare that memory using
>> dma_declare_coherent_memory() before
>> alloc_from_coherent.
>
> This isn't true.  Almost every platform has a mechanism for
> manufacturing coherent memory (in the worst case, they just turn off the
> CPU cache on a page and hand it out).  The purpose of
> dma_declare_coherent_memory() is to allow a per device declaration of
> preferred regions ... usually because they reside either on the fast
> path to the device or sometimes on the device itself.  There are only a
> handful of devices which need it, so in the ordinary course of events,
> dma_alloc_coherent() is used without any memory declaration.
>

Sorry for my ambiguity.
It obviously true we can use dma_alloc_coherent() without any memory
declaration.

I thought Tony's original idea was want to make
dma_alloc_from_coherent() return success.
But the dev->dma_mem check can't pass, so i suggested him using
dma_declare_coherent_memory()
to declare per-device area first.

Thanks,
--Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2012-10-17  2:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1350192523.10946.4.camel@gitbox>
2012-10-14 20:34 ` Tony Prisk
2012-10-14 22:26   ` Tony Prisk
2012-10-15  6:42     ` Tomasz Figa
2012-10-15  8:03       ` Tony Prisk
2012-10-15 13:35         ` Marek Szyprowski
2012-10-15  9:45   ` Mel Gorman
2012-10-15 18:28     ` Tony Prisk
2012-10-16  2:17       ` Bob Liu
2012-10-16  5:02         ` Tony Prisk
2012-10-16  5:54         ` Tony Prisk
2012-10-16  6:50           ` Tony Prisk
2012-10-16  7:58             ` Mel Gorman
2012-10-16  8:13               ` Tony Prisk
2012-10-16 14:41         ` James Bottomley
2012-10-17  2:26           ` Bob Liu [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='CAA_GA1d_twVqv9jOGx74wvYiuJwQQDAN-NJB_x61df=--yP6Og@mail.gmail.com' \
    --to=lliubbo@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@prisktech.co.nz \
    --cc=mgorman@suse.de \
    /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