[PATCH] asm-i386/atomic.h: local_irq_save should be used instead of local_irq_disable

From: lepton
Date: Tue Apr 11 2006 - 09:00:37 EST


Hi!
When I read the kernel codes, I think this perhaps be a little
bug, What do you think about this?

See the following patch (against 2.6.16.3)

Signed-off-by: Lepton Wu <ytht.net@xxxxxxxxx>

diff -pru linux-2.6-curr.orig/include/asm-i386/atomic.h linux-2.6-curr.lepton/include/asm-i386/atomic.h
--- linux-2.6-curr.orig/include/asm-i386/atomic.h 2006-04-06 09:21:53.000000000 +0800
+++ linux-2.6-curr.lepton/include/asm-i386/atomic.h 2006-04-11 20:47:39.000000000 +0800
@@ -189,6 +189,7 @@ static __inline__ int atomic_add_return(
{
int __i;
#ifdef CONFIG_M386
+ unsigned long flags;
if(unlikely(boot_cpu_data.x86==3))
goto no_xadd;
#endif
@@ -202,10 +203,10 @@ static __inline__ int atomic_add_return(

#ifdef CONFIG_M386
no_xadd: /* Legacy 386 processor */
- local_irq_disable();
+ local_irq_save(flags);
__i = atomic_read(v);
atomic_set(v, i + __i);
- local_irq_enable();
+ local_irq_restore(flags);
return i + __i;
#endif
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/