From: adharmap@codeaurora.org (Abhijeet Dharmapurikar)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH] ARM: Change the mandatory barriers implementation
Date: Wed, 03 Feb 2010 16:21:47 -0800 [thread overview]
Message-ID: <4B6A131B.1070005@codeaurora.org> (raw)
In-Reply-To: <20100203161434.15912.42697.stgit@pc1117.cambridge.arm.com>
> The mandatory barriers (mb, rmb, wmb) are used even on uniprocessor
> systems for things like ordering Normal Non-cacheable memory accesses
> with DMA transfer (via Device memory writes). The current implementation
> uses dmb() for mb() and friends but this is not sufficient. The DMB only
> ensures the ordering of accesses with regards to a single observer
> accessing the same memory. If a DMA transfer is started by a write to
> Device memory, the data to be transfered may not reach the main memory
> (even if mapped as Normal Non-cacheable) before the device receives the
> notification to begin the transfer. The only barrier that would help in
> this situation is DSB which would completely drain the write buffers.
On ARMv7, DMB guarantees that all accesses prior to DMB are observed by
an observer if that observer sees any accesses _after_ the DMB. In this
case, since DMA engine observes a write to itself( It is being written
to and hence must observe the write) it should also see the writes to
the buffers. A dmb() after the writes to buffer and before write to DMA
engine should suffice.
Moreover an mb() could be in places where accesses to ARM's Device type
memory need ordering and are 1kb apart. Such usages of mb() would result
in a dsb() and could cause performance problems.
Since you mention the write buffers this probably applies only to ARMv6.
Correct me here, I think that dmb on ARMv6 should suffice too.
next prev parent reply other threads:[~2010-02-04 0:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-03 16:15 [RFC PATCH] ARM: Change the mandatory barriers implementation Catalin Marinas
2010-02-04 0:21 ` Abhijeet Dharmapurikar [this message]
2010-02-04 5:15 ` Shilimkar, Santosh
2010-02-04 13:15 ` Catalin Marinas
2010-02-04 16:39 ` Tony Lindgren
2010-02-05 11:04 ` Catalin Marinas
2010-02-08 19:17 ` Abhijeet Dharmapurikar
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=4B6A131B.1070005@codeaurora.org \
--to=adharmap@codeaurora.org \
--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