Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Oct 2011 15:34:18 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r226567 - stable/9/sys/powerpc/powerpc
Message-ID:  <201110201534.p9KFYIZQ080473@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Thu Oct 20 15:34:17 2011
New Revision: 226567
URL: http://svn.freebsd.org/changeset/base/226567

Log:
  MFC r226410:
  Enforce a memory barrier in stream operations, as is done on other
  bus_space calls. This makes ath(4) work correctly on PowerPC.
  
  Submitted by:	adrian
  Tested by:	andreast
  Approved by:	re (kib)

Modified:
  stable/9/sys/powerpc/powerpc/bus_machdep.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/powerpc/powerpc/bus_machdep.c
==============================================================================
--- stable/9/sys/powerpc/powerpc/bus_machdep.c	Thu Oct 20 14:56:44 2011	(r226566)
+++ stable/9/sys/powerpc/powerpc/bus_machdep.c	Thu Oct 20 15:34:17 2011	(r226567)
@@ -293,6 +293,7 @@ bs_be_ws_1(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	*addr = val;
+	__asm __volatile("eieio; sync");
 	CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val);
 }
 
@@ -303,6 +304,7 @@ bs_be_ws_2(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	*addr = val;
+	__asm __volatile("eieio; sync");
 	CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val);
 }
 
@@ -313,6 +315,7 @@ bs_be_ws_4(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	*addr = val;
+	__asm __volatile("eieio; sync");
 	CTR4(KTR_BE_IO, "%s(bsh=%#x, ofs=%#x, val=%#x)", __func__, bsh, ofs, val);
 }
 
@@ -323,6 +326,7 @@ bs_be_ws_8(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	*addr = val;
+	__asm __volatile("eieio; sync");
 }
 
 static void
@@ -488,6 +492,7 @@ bs_le_rs_1(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	res = *addr;
+	__asm __volatile("eieio; sync");
 	CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res);
 	return (res);
 }
@@ -500,6 +505,7 @@ bs_le_rs_2(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	__asm __volatile("lhbrx %0, 0, %1" : "=r"(res) : "r"(addr));
+	__asm __volatile("eieio; sync");
 	CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res);
 	return (res);
 }
@@ -512,6 +518,7 @@ bs_le_rs_4(bus_space_handle_t bsh, bus_s
 
 	addr = __ppc_ba(bsh, ofs);
 	__asm __volatile("lwbrx %0, 0, %1" : "=r"(res) : "r"(addr));
+	__asm __volatile("eieio; sync");
 	CTR4(KTR_LE_IO, "%s(bsh=%#x, ofs=%#x) = %#x", __func__, bsh, ofs, res);
 	return (res);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201110201534.p9KFYIZQ080473>