linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tom.leiming@gmail.com (tom.leiming at gmail.com)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: fix badly implementation of wmb
Date: Sat, 16 Apr 2011 00:21:51 +0800	[thread overview]
Message-ID: <1302884511-14152-1-git-send-email-tom.leiming@gmail.com> (raw)

From: Ming Lei <tom.leiming@gmail.com>

Commit e7c5650f6067f65f8e961394f376d4862808d0d2

	ARM: 5996/1: ARM: Change the mandatory barriers implementation (4/4)

implements wmb as dsb plus outer_sync, which will make wmb
much more strict than required. In fact, it is enough for dmb to
keep the partial order of two stores, so restore wmb as dmb to
fix possible performance degrade caused by the commit e7c5650f.

Also the patch defines __iowmb as mb to fix the issue which the
commit e7c5650f addressed.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
---
 arch/arm/include/asm/io.h     |    2 +-
 arch/arm/include/asm/system.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index d66605d..b2cd9f2 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -98,7 +98,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
 /* IO barriers */
 #ifdef CONFIG_ARM_DMA_MEM_BUFFERABLE
 #define __iormb()		rmb()
-#define __iowmb()		wmb()
+#define __iowmb()		mb()
 #else
 #define __iormb()		do { } while (0)
 #define __iowmb()		do { } while (0)
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 885be09..1ec2c25 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -160,7 +160,7 @@ extern unsigned int user_debug;
 #elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
 #define mb()		do { dsb(); outer_sync(); } while (0)
 #define rmb()		dmb()
-#define wmb()		mb()
+#define wmb()		dmb()
 #else
 #include <asm/memory.h>
 #define mb()	do { if (arch_is_coherent()) dmb(); else barrier(); } while (0)
-- 
1.7.3

             reply	other threads:[~2011-04-15 16:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-15 16:21 tom.leiming at gmail.com [this message]
2011-04-16 20:50 ` [PATCH] ARM: fix badly implementation of wmb Russell King - ARM Linux
2011-04-17  7:23 ` Catalin Marinas
2011-04-17  7:40   ` Ming Lei

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=1302884511-14152-1-git-send-email-tom.leiming@gmail.com \
    --to=tom.leiming@gmail.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).