linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/4] ARM: Change the mandatory barriers implementation
Date: Tue, 23 Feb 2010 17:33:34 +0000	[thread overview]
Message-ID: <20100223173334.GA13519@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20100223110105.11048.8143.stgit@e102109-lin.cambridge.arm.com>

On Tue, Feb 23, 2010 at 11:01:05AM +0000, Catalin Marinas wrote:
> 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.

Erm, I also don't think your statement here is right.  DMB is defined in
the ARM ARM to be by default a full-system, read/write memory barrier.
It has this property:

  If the required shareability is Full system then the operation applies
  to all observers within the system.
...
  Any observer with the same required shareability domain as Pe observes
  all members of Group A before it observes any member of Group B to the
  extent that those group members are required to be observed, as
  determined by the shareability and cacheability of the memory locations
  accessed by the group members.  Where members of Group A and Group B
  access the same memory-mapped peripheral, all members of Group A will
  be visible at the memory-mapped peripheral before any members of Group
  B are visible at that peripheral.

This most definitely is not "single observer" - it's all observers within
the same "shareability domain".  That may encompass all CPUs and not
devices and DMA agents.

I'd go further - in the case of:

	write to non-cacheable memory
	dmb();
	write to peripheral

then, because the dmb() is a full system dmb, all observers within the
system should see the write to non-cacheable memory before the write to
peripheral.

Either that or the ARM ARM is unclear/wrong about what "all observers"
means.

  parent reply	other threads:[~2010-02-23 17:33 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-23 11:01 [PATCH 1/4] ARM: Change the mandatory barriers implementation Catalin Marinas
2010-02-23 11:10 ` Russell King - ARM Linux
2010-02-23 12:16   ` Catalin Marinas
2010-02-23 12:30     ` Russell King - ARM Linux
2010-02-23 15:12       ` Catalin Marinas
2010-02-23 15:24         ` Russell King - ARM Linux
2010-02-23 16:02           ` Catalin Marinas
2010-02-23 18:03             ` Russell King - ARM Linux
2010-02-23 18:07               ` Catalin Marinas
2010-03-01  3:37                 ` Jamie Lokier
2010-02-26 15:43               ` Catalin Marinas
2010-03-01  3:44                 ` Jamie Lokier
2010-02-23 12:21   ` Catalin Marinas
2010-02-23 12:31     ` Russell King - ARM Linux
2010-02-23 11:35 ` Shilimkar, Santosh
2010-02-23 11:41   ` Russell King - ARM Linux
2010-02-23 17:33 ` Russell King - ARM Linux [this message]
2010-02-23 17:58   ` Catalin Marinas
2010-02-23 18:04     ` Catalin Marinas

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=20100223173334.GA13519@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;
as well as URLs for NNTP newsgroup(s).