Skip to contentSkip to conversation

io-apic cleanup #2, BK-curr

PATCH New Ingo Molnar 2 participants 3 messages May 27, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io-apic cleanup #2, BK-curr

the patch below gets rid of APIC_LOCKUP_DEBUG. It has been in the kernel for more than 3 years and the message was only reported once during that period of time - and even in that case it was a side-effect of a really bad crash. The lockup workaround works, the debugging code can be moved out.

Ingo

arch/i386/kernel/io_apic.c renamed from arch/i386/kernel/io_apic.c.orig +0 -21
@@ -41,8 +41,6 @@
 
 #include "io_ports.h"
 
-#define APIC_LOCKUP_DEBUG
-
 static spinlock_t ioapic_lock = SPIN_LOCK_UNLOCKED;
 
 /*
@@ -1858,30 +1856,11 @@ static void end_level_ioapic_irq (unsign
 	ack_APIC_irq();
 
 	if (!(v & (1 << (i & 0x1f)))) {
-#ifdef APIC_LOCKUP_DEBUG
-		struct irq_pin_list *entry;
-#endif
-
 #ifdef APIC_MISMATCH_DEBUG
 		atomic_inc(&irq_mis_count);
 #endif
 		spin_lock(&ioapic_lock);
 		__mask_and_edge_IO_APIC_irq(irq);
-#ifdef APIC_LOCKUP_DEBUG
-		for (entry = irq_2_pin + irq;;) {
-			unsigned int reg;
-
-			if (entry->pin == -1)
-				break;
-			reg = io_apic_read(entry->apic, 0x10 + entry->pin * 2);
-			if (reg & 0x00004000)
-				printk(KERN_CRIT "Aieee!!!  Remote IRR"
-					" still set after unlock!\n");
-			if (!entry->next)
-				break;
-			entry = irq_2_pin + entry->next;
-		}
-#endif
 		__unmask_and_level_IO_APIC_irq(irq);
 		spin_unlock(&ioapic_lock);
 	}
#1 lore raw

PATCH 1/1 io-apic cleanup #3, BK-curr

the patch below gets rid of io_apic_sync().

io_apic_sync() was introduced in 2.1.104 and it was originally done for masking and unmasking as well. Later the unmasking use got removed but the masking use lingered around. I dont think it was ever justified to do it and clearly since the lack of io_apic_sync() didnt break some of the other writes we do to the IO-APIC registers, it must be unnecessary in the masking case too. Maciej?

Ingo

arch/i386/kernel/io_apic.c renamed from arch/i386/kernel/io_apic.c.orig +0 -3
@@ -145,10 +145,7 @@ static void __modify_IO_APIC_irq (unsign
 /* mask = 1 */
 static void __mask_IO_APIC_irq (unsigned int irq)
 {
-	struct irq_pin_list *entry = irq_2_pin + irq;
 	__modify_IO_APIC_irq(irq, 0x00010000, 0);
-	/* Is it needed? Or do others need it too? */
-	io_apic_sync(entry->apic);
 }
 
 /* mask = 0 */
include/asm-i386/io_apic.h renamed from include/asm-i386/io_apic.h.orig +0 -9
@@ -188,15 +188,6 @@ static inline void io_apic_modify(unsign
 	*(IO_APIC_BASE(apic)+4) = value;
 }
 
-/*
- * Synchronize the IO-APIC and the CPU by doing
- * a dummy read from the IO-APIC
- */
-static inline void io_apic_sync(unsigned int apic)
-{
-	(void) *(IO_APIC_BASE(apic)+4);
-}
-
 /* 1 if "noapic" boot option passed */
 extern int skip_ioapic_setup;
 
#2 lore raw

Re: [patch] io-apic cleanup #3, BK-curr

Quoted 6 lines · Ingo Molnar

io_apic_sync() was introduced in 2.1.104 and it was originally done for masking and unmasking as well. Later the unmasking use got removed but the masking use lingered around. I dont think it was ever justified to do it and clearly since the lack of io_apic_sync() didnt break some of the other writes we do to the IO-APIC registers, it must be unnecessary in the masking case too. Maciej?

Go ahead, sure.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +