linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ccross@google.com (Colin Cross)
To: linux-arm-kernel@lists.infradead.org
Subject: mapping uncached memory
Date: Wed, 17 Mar 2010 14:26:32 -0700	[thread overview]
Message-ID: <d73d4eaf1003171426y35f9c431l93182fa73b3a5084@mail.gmail.com> (raw)
In-Reply-To: <20100317081520.GA15954@n2100.arm.linux.org.uk>

On Wed, Mar 17, 2010 at 1:15 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Wed, Mar 17, 2010 at 10:02:09AM +0200, Budhee Jamaich wrote:
>> On Wed, Mar 17, 2010 at 1:54 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> from Documentation/DMA-API.txt:
>>
>> "void *
>> dma_alloc_coherent(struct device *dev, size_t size,
>> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?dma_addr_t *dma_handle, gfp_t flag)
>>
>> Consistent memory is memory for which a write by either the device or
>> the processor can immediately be read by the processor or device
>> without having to worry about caching effects. ?(You may however need
>> to make sure to flush the processor's write buffers before telling
>> devices to read that memory.)"
>>
>>
>>
>> That last sentence - what does it really say ? That I still need to
>> manually clean/invalidate the caches myself ?
>
> No - if it did, it would contradict the previous sentence. ?What it's
> referring to is that on weakly ordered CPUs, you may need barriers.

Tegra2 needs a wmb() and an L2 cache sync on dma_alloc_coherent memory
before handing it to the device.  Currently, I am using Catalin's
patches for machine-specific wmb() implementations to do both
operations using a wmb() and keep the L2 details out of the drivers.
Is that the correct use of those patches?  Is there any other way to
handle dma_alloc_coherent memory on ARMv7?

  parent reply	other threads:[~2010-03-17 21:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 23:17 mapping uncached memory Budhee Jamaich
2010-03-16 23:54 ` Russell King - ARM Linux
2010-03-17  4:34   ` Jamie Lokier
2010-03-17  8:02   ` Budhee Jamaich
2010-03-17  8:15     ` Russell King - ARM Linux
2010-03-17  9:09       ` Budhee Jamaich
2010-03-17 21:26       ` Colin Cross [this message]
2010-03-17 22:03         ` Catalin Marinas
2010-03-23 12:22   ` Budhee Jamaich

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=d73d4eaf1003171426y35f9c431l93182fa73b3a5084@mail.gmail.com \
    --to=ccross@google.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).