[kernel] r11752 - in dists/trunk/linux-2.6/debian: . patches/bugfix/mips patches/series

Thiemo Seufer ths at alioth.debian.org
Thu Jul 3 18:13:11 UTC 2008


Author: ths
Date: Thu Jul  3 18:13:10 2008
New Revision: 11752

Log:
  * [mips] Fix logic bug in atomic_sub_if_positive.


Added:
   dists/trunk/linux-2.6/debian/patches/bugfix/mips/atomic_sub_if_positive.patch
Modified:
   dists/trunk/linux-2.6/debian/changelog
   dists/trunk/linux-2.6/debian/patches/series/1~experimental.1

Modified: dists/trunk/linux-2.6/debian/changelog
==============================================================================
--- dists/trunk/linux-2.6/debian/changelog	(original)
+++ dists/trunk/linux-2.6/debian/changelog	Thu Jul  3 18:13:10 2008
@@ -108,6 +108,9 @@
   [ Christian T. Steigies ]
   * [m68k] enable SERIAL_CONSOLE for amiga and atari
 
+  [ Thiemo Seufer ]
+  * [mips] Fix logic bug in atomic_sub_if_positive.
+
  -- Christian T. Steigies <cts at debian.org>  Thu, 12 Jun 2008 15:31:54 +0200
 
 linux-2.6 (2.6.25-1~experimental.1) UNRELEASED; urgency=low

Added: dists/trunk/linux-2.6/debian/patches/bugfix/mips/atomic_sub_if_positive.patch
==============================================================================
--- (empty file)
+++ dists/trunk/linux-2.6/debian/patches/bugfix/mips/atomic_sub_if_positive.patch	Thu Jul  3 18:13:10 2008
@@ -0,0 +1,35 @@
+From: Morten Larsen <mlarsen at broadcom.com>
+
+As far as I can tell the branch optimization fixes in 2.6.21 introduced
+a bug in atomic_sub_if_positive that causes it to return even when the
+sc instruction fails. The result is that e.g. down_trylock becomes
+unreliable as the semaphore counter is not always decremented.
+
+
+--- a/include/asm-mips/atomic.h	2008-06-25 22:38:43.159739000 -0700
++++ b/include/asm-mips/atomic.h	2008-06-25 22:39:07.552065000 -0700
+@@ -292,10 +292,10 @@ static __inline__ int atomic_sub_if_posi
+ 		"	beqz	%0, 2f					\n"
+ 		"	 subu	%0, %1, %3				\n"
+ 		"	.set	reorder					\n"
+-		"1:							\n"
+ 		"	.subsection 2					\n"
+ 		"2:	b	1b					\n"
+ 		"	.previous					\n"
++		"1:							\n"
+ 		"	.set	mips0					\n"
+ 		: "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ 		: "Ir" (i), "m" (v->counter)
+@@ -682,10 +682,10 @@ static __inline__ long atomic64_sub_if_p
+ 		"	beqz	%0, 2f					\n"
+ 		"	 dsubu	%0, %1, %3				\n"
+ 		"	.set	reorder					\n"
+-		"1:							\n"
+ 		"	.subsection 2					\n"
+ 		"2:	b	1b					\n"
+ 		"	.previous					\n"
++		"1:							\n"
+ 		"	.set	mips0					\n"
+ 		: "=&r" (result), "=&r" (temp), "=m" (v->counter)
+ 		: "Ir" (i), "m" (v->counter)
+

Modified: dists/trunk/linux-2.6/debian/patches/series/1~experimental.1
==============================================================================
--- dists/trunk/linux-2.6/debian/patches/series/1~experimental.1	(original)
+++ dists/trunk/linux-2.6/debian/patches/series/1~experimental.1	Thu Jul  3 18:13:10 2008
@@ -26,6 +26,7 @@
 + bugfix/mips/ip22_cache_shift.patch
 + bugfix/mips/gbefb_fix_cmap_fifo_timeout.patch
 + bugfix/mips/ip32_enable_fast_20.patch
++ bugfix/mips/atomic_sub_if_positive.patch
 + bugfix/arm/disable-dvb_b2c2_flexcop.patch
 + bugfix/arm/disable-dvb_budget.patch
 + bugfix/arm/disable-netxen_nic.patch



More information about the Kernel-svn-changes mailing list