All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Roland Dreier <roland@topspin.com>, Andrew Morton <akpm@osdl.org>
Cc: anton@au.ibm.com,
	linuxppc64-dev <linuxppc64-dev@lists.linuxppc.org>,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix ppc64 out_be64
Date: Sun, 13 Jun 2004 12:11:23 -0500	[thread overview]
Message-ID: <1087146682.8697.184.camel@gaston> (raw)
In-Reply-To: <52llir5rr2.fsf@topspin.com>


> Yes, that looks fine (after fixing val to be unsigned long in
> out_be64).  You know infinitely more about ppc64 asm than I do so I'm
> sure your version is better.

Well, I may know ppc asm, but gcc inline asm still drives me nuts :)

Here's a fixed version (Andrew, please apply)

----

Patch fixes out_be64 implementation on ppc64 along with a glich in
out_be32 (inconsistent) use of barrier.

Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

===== include/asm-ppc64/io.h 1.18 vs edited =====
--- 1.18/include/asm-ppc64/io.h	2004-05-21 02:50:11 -05:00
+++ edited/include/asm-ppc64/io.h	2004-06-13 12:09:16 -05:00
@@ -307,7 +307,7 @@
 
 static inline void out_be32(volatile unsigned *addr, int val)
 {
-	__asm__ __volatile__("stw%U0%X0 %1,%0; eieio"
+	__asm__ __volatile__("stw%U0%X0 %1,%0; sync"
 			     : "=m" (*addr) : "r" (val));
 }
 
@@ -356,9 +356,9 @@
 			     : "=&r" (tmp) , "=&r" (val) : "1" (val) , "b" (addr) , "m" (*addr));
 }
 
-static inline void out_be64(volatile unsigned long *addr, int val)
+static inline void out_be64(volatile unsigned long *addr, unsigned long val)
 {
-	__asm__ __volatile__("std %1,0(%0); sync" : "=m" (*addr) : "r" (val));
+	__asm__ __volatile__("std%U0%X0 %1,%0; sync" : "=m" (*addr) : "r" (val));
 }
 
 #ifndef CONFIG_PPC_ISERIES 



  reply	other threads:[~2004-06-13 17:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-12 22:00 [PATCH] Fix ppc64 out_be64 Roland Dreier
2004-06-13 15:50 ` Benjamin Herrenschmidt
2004-06-13 16:21   ` Anton Blanchard
2004-06-13 17:08     ` Benjamin Herrenschmidt
2004-06-13 16:48   ` Roland Dreier
2004-06-13 17:11     ` Benjamin Herrenschmidt [this message]
2004-06-14 20:26       ` Roland Dreier
2004-06-14 21:10         ` Benjamin Herrenschmidt

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=1087146682.8697.184.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=akpm@osdl.org \
    --cc=anton@au.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@lists.linuxppc.org \
    --cc=roland@topspin.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.