[kernel] r6191 - in dists/trunk/linux-2.6/debian: . patches
patches/series
Martin Michlmayr
tbm at costa.debian.org
Wed Mar 15 13:56:37 UTC 2006
Author: tbm
Date: Wed Mar 15 13:56:35 2006
New Revision: 6191
Added:
dists/trunk/linux-2.6/debian/patches/mips-io-bad-code.patch
Modified:
dists/trunk/linux-2.6/debian/changelog
dists/trunk/linux-2.6/debian/patches/series/0experimental.1
Log:
[mips] Work around bad code generation for <asm/io.h> (Ralf Baechle).
Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog (original)
+++ dists/trunk/linux-2.6/debian/changelog Wed Mar 15 13:56:35 2006
@@ -13,6 +13,7 @@
* [mips] SB1: Support for 1480 ethernet (Broadcom).
* [mips] SB1: Support for NAPI (Tom Rix).
* [mips] SB1: DUART support (Broadcom).
+ * [mips] Work around bad code generation for <asm/io.h> (Ralf Baechle).
[ dann frazier ]
* [ia64] use yaird on ia64 until #341181 is fixed
Added: dists/trunk/linux-2.6/debian/patches/mips-io-bad-code.patch
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/mips-io-bad-code.patch Wed Mar 15 13:56:35 2006
@@ -0,0 +1,59 @@
+From: linux-mips at linux-mips.org
+Date: Wed, 15 Mar 2006 11:28:15 +0000
+To: git-commits at linux-mips.org
+Subject: [MIPS] Work around bad code generation for <asm/io.h>.
+
+Author: Ralf Baechle <ralf at linux-mips.org> Wed Mar 15 11:36:31 2006 +0000
+Commit: 6a186683e0a3d51836b6ef6b971508861c7002b5
+Gitweb: http://www.linux-mips.org/g/linux/6a186683
+Branch: master
+
+If a call to set_io_port_base() was being followed by usage of
+mips_io_port_base in the same function gcc was possibly using the old
+value due to some clever abuse of const. Adding a barrier will keep
+the optimization and result in correct code with latest gcc.
+
+Signed-off-by: Ralf Baechle <ralf at linux-mips.org>
+
+---
+
+ include/asm-mips/io.h | 18 +++++++++++++++---
+ 1 files changed, 15 insertions(+), 3 deletions(-)
+
+diff --git a/include/asm-mips/io.h b/include/asm-mips/io.h
+index 5c6d6ab..02995ad 100644
+--- a/include/asm-mips/io.h
++++ b/include/asm-mips/io.h
+@@ -4,7 +4,7 @@
+ * for more details.
+ *
+ * Copyright (C) 1994, 1995 Waldorf GmbH
+- * Copyright (C) 1994 - 2000 Ralf Baechle
++ * Copyright (C) 1994 - 2000, 06 Ralf Baechle
+ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
+ * Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
+ * Author: Maciej W. Rozycki <macro at mips.com>
+@@ -103,8 +103,20 @@
+ */
+ extern const unsigned long mips_io_port_base;
+
+-#define set_io_port_base(base) \
+- do { * (unsigned long *) &mips_io_port_base = (base); } while (0)
++/*
++ * Gcc will generate code to load the value of mips_io_port_base after each
++ * function call which may be fairly wasteful in some cases. So we don't
++ * play quite by the book. We tell gcc mips_io_port_base is a long variable
++ * which solves the code generation issue. Now we need to violate the
++ * aliasing rules a little to make initialization possible and finally we
++ * will need the barrier() to fight side effects of the aliasing chat.
++ * This trickery will eventually collapse under gcc's optimizer. Oh well.
++ */
++static inline void set_io_port_base(unsigned long base)
++{
++ * (unsigned long *) &mips_io_port_base;
++ barrier();
++}
+
+ /*
+ * Thanks to James van Artsdalen for a better timing-fix than
+
Modified: dists/trunk/linux-2.6/debian/patches/series/0experimental.1
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/0experimental.1 (original)
+++ dists/trunk/linux-2.6/debian/patches/series/0experimental.1 Wed Mar 15 13:56:35 2006
@@ -23,5 +23,6 @@
+ mips-sb1-eth-1480.patch
+ mips-sb1-eth-napi.patch
+ mips-sb1-duart.patch
++ mips-io-bad-code.patch
+ s390-drivers-ccw-uevent-modalias.patch
+ s390-drivers-ccw-uevent-cleanup.patch
More information about the Kernel-svn-changes
mailing list