Re: [patch] SMP race fix [was Re: SMP lockup & 3c509 on 2.2.x [aka.

Andrea Arcangeli (andrea@e-mind.com)
Thu, 6 May 1999 15:52:57 +0200 (CEST)


On Thu, 6 May 1999, Andrea Arcangeli wrote:

> void disable_irq(unsigned int irq)
> {
> __disable_irq(irq);
>+
>+ if (in_interrupt())
^^^^^^^^^^^^^^ this should be an local_irq_count[smp_processor_id()]

I put here a better patch:

Index: arch/i386/kernel/irq.c
===================================================================
RCS file: /var/cvs/linux/arch/i386/kernel/irq.c,v
retrieving revision 1.1.2.28
diff -u -r1.1.2.28 irq.c
--- irq.c 1999/05/05 19:52:54 1.1.2.28
+++ linux/arch/i386/kernel/irq.c 1999/05/06 12:42:55
@@ -759,7 +759,7 @@
* hardware disable after having gotten the irq
* controller lock.
*/
-static inline __disable_irq(unsigned int irq)
+static inline void __disable_irq(unsigned int irq)
{
unsigned long flags;

@@ -774,8 +774,16 @@
void disable_irq(unsigned int irq)
{
__disable_irq(irq);
+
+ if (local_irq_count[smp_processor_id()])
+ goto from_irq;
+
while (irq_desc[irq].status & IRQ_INPROGRESS)
barrier();
+ return;
+
+ from_irq:
+ printk(KERN_ERR "disable_irq: can't synchronize irq %d!\n", irq);
}

void disable_irq_nosync(unsigned int irq)

(again this patch is not strictly needed, and for the record it's against
my last big patch I sent to the list in my email sent on Wed, 5 May 1999
21:52:33 +0200. BTW did somebody tried such my patch yet? Taneli,
Nicholas, M.H?).

Andrea Arcangeli

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/