The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] i386: fix early usage of atomic_add_return and local_add_return on real i386
@ 2007-05-22  9:48 Thomas Gleixner
  2007-05-22 10:34 ` Andi Kleen
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2007-05-22  9:48 UTC (permalink / raw)
  To: LKML; +Cc: Andrew Morton, Ingo Molnar, Andi Kleen

The check (boot_cpu_data.x86 == 3) in atomic_add_return() and
local_add_return() fails, when those operations are used before
boot_cpu_data is filled in.

Change the check to (boot_cpu_data.x86 <= 3) to fix this.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>


Index: linux-2.6/include/asm-i386/atomic.h
===================================================================
--- linux-2.6.orig/include/asm-i386/atomic.h
+++ linux-2.6/include/asm-i386/atomic.h
@@ -182,7 +182,7 @@ static __inline__ int atomic_add_return(
 	int __i;
 #ifdef CONFIG_M386
 	unsigned long flags;
-	if(unlikely(boot_cpu_data.x86==3))
+	if(unlikely(boot_cpu_data.x86 <= 3))
 		goto no_xadd;
 #endif
 	/* Modern 486+ processor */
Index: linux-2.6/include/asm-i386/local.h
===================================================================
--- linux-2.6.orig/include/asm-i386/local.h
+++ linux-2.6/include/asm-i386/local.h
@@ -135,7 +135,7 @@ static __inline__ long local_add_return(
 	long __i;
 #ifdef CONFIG_M386
 	unsigned long flags;
-	if(unlikely(boot_cpu_data.x86==3))
+	if(unlikely(boot_cpu_data.x86 <= 3))
 		goto no_xadd;
 #endif
 	/* Modern 486+ processor */



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-22 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-22  9:48 [PATCH] i386: fix early usage of atomic_add_return and local_add_return on real i386 Thomas Gleixner
2007-05-22 10:34 ` Andi Kleen
2007-05-22 10:37   ` Thomas Gleixner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox