From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] ARM: dma-mapping: outer cache is invalidated twice
Date: Tue, 15 Feb 2011 14:12:53 +0000 [thread overview]
Message-ID: <20110215141253.GJ4152@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <AANLkTi=Fs5+3yG-_4u0oU8WK4K4FU_8zN38H=RNcgRNU@mail.gmail.com>
On Tue, Feb 15, 2011 at 02:54:21PM +0100, Per Forlin wrote:
> I don't fully understand this yet. I think you are right but I need a
> little help to get there myself.
> I agree, the cache (L1 and L2) must be invalidated after the DMA has completed.
> Before starting the DMA the write buffers must be drained (cache_sync).
>
> Why invalidate the cache before starting the DMA?
Think about what happens if you have dirty cache lines in the DMA region.
These can be evicted when other cache lines are loaded, which will result
in them overwriting contents of memory. If the DMA device has already
written to that memory, the result is data corruption.
So, the invalidate prior to DMA is to get rid of any dirty cache lines
which could be written back to memory.
next prev parent reply other threads:[~2011-02-15 14:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 13:14 [RFC] ARM: dma-mapping: outer cache is invalidated twice Per Forlin
2011-02-15 13:32 ` Russell King - ARM Linux
2011-02-15 13:41 ` Russell King - ARM Linux
2011-02-15 13:54 ` Per Forlin
2011-02-15 14:12 ` Russell King - ARM Linux [this message]
2011-02-15 15:11 ` Per Forlin
2011-02-15 15:46 ` Russell King - ARM Linux
2011-02-15 22:42 ` Per Forlin
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=20110215141253.GJ4152@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