All of lore.kernel.org
 help / color / mirror / Atom feed
From: James.Bottomley@HansenPartnership.com (James Bottomley)
To: linux-arm-kernel@lists.infradead.org
Subject: dma_alloc_coherent fails in framebuffer
Date: Tue, 16 Oct 2012 07:41:41 -0700	[thread overview]
Message-ID: <1350398501.2532.12.camel@dabdike> (raw)
In-Reply-To: <CAA_GA1cPE+m8N1LQA2iOym4jbFwcHG+K2p-3iBovPWuf1N1q+g@mail.gmail.com>

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.

James

WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Bob Liu <lliubbo@gmail.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: Tue, 16 Oct 2012 07:41:41 -0700	[thread overview]
Message-ID: <1350398501.2532.12.camel@dabdike> (raw)
In-Reply-To: <CAA_GA1cPE+m8N1LQA2iOym4jbFwcHG+K2p-3iBovPWuf1N1q+g@mail.gmail.com>

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.

James


--
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>

  parent reply	other threads:[~2012-10-16 14:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-14  5:28 dma_alloc_coherent fails in framebuffer Tony Prisk
2012-10-14 20:34 ` Tony Prisk
2012-10-14 20:34   ` Tony Prisk
2012-10-14 22:26   ` Tony Prisk
2012-10-14 22:26     ` Tony Prisk
2012-10-15  6:42     ` Tomasz Figa
2012-10-15  6:42       ` Tomasz Figa
2012-10-15  8:03       ` Tony Prisk
2012-10-15  8:03         ` Tony Prisk
2012-10-15 13:35         ` Marek Szyprowski
2012-10-15 13:35           ` Marek Szyprowski
2012-10-15  9:45   ` Mel Gorman
2012-10-15  9:45     ` Mel Gorman
2012-10-15 18:28     ` Tony Prisk
2012-10-15 18:28       ` Tony Prisk
2012-10-16  2:17       ` Bob Liu
2012-10-16  2:17         ` Bob Liu
2012-10-16  5:02         ` Tony Prisk
2012-10-16  5:54         ` Tony Prisk
2012-10-16  5:54           ` Tony Prisk
2012-10-16  6:50           ` Tony Prisk
2012-10-16  6:50             ` Tony Prisk
2012-10-16  7:58             ` Mel Gorman
2012-10-16  7:58               ` Mel Gorman
2012-10-16  8:13               ` Tony Prisk
2012-10-16  8:13                 ` Tony Prisk
2012-10-16 14:41         ` James Bottomley [this message]
2012-10-16 14:41           ` James Bottomley
2012-10-17  2:26           ` Bob Liu
2012-10-17  2:26             ` Bob Liu

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=1350398501.2532.12.camel@dabdike \
    --to=james.bottomley@hansenpartnership.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 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.