Skip to contentSkip to conversation

x86, ioapic: only print ioapic debug information for IRQs belonging to an ioapic chip

PATCH New Mathias Nyman 1 participant 1 message Oct 10, 2011 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, ioapic: only print ioapic debug information for IRQs belonging to an ioapic chip

with "apic=verbose" the print_IO_APIC() function tries to print IRQ to pin mappings for every active irq. It assumes chip_data is of type irq_cfg and may cause an oops if not.

As the print_IO_APIC() is called from a late_initcall other chained irq chips may already be registered with custom chip_data information, causing an oops. This is the case with intel MID SoC devices with gpio demuxers registered as irq_chips.

---
 arch/x86/kernel/apic/io_apic.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/x86/kernel/apic/io_apic.c +5 -0
index 472e094..0a37ec0 100644
@@ -1499,6 +1499,7 @@ __apicdebuginit(void) print_IO_APIC(void)
 	unsigned long flags;
 	struct irq_cfg *cfg;
 	unsigned int irq;
+	struct irq_chip *chip;
 
 	printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
 	for (i = 0; i < nr_ioapics; i++)
@@ -1618,6 +1619,10 @@ __apicdebuginit(void) print_IO_APIC(void)
 	for_each_active_irq(irq) {
 		struct irq_pin_list *entry;
 
+		chip = irq_get_chip(irq);
+		if (chip != &ioapic_chip && chip != &ir_ioapic_chip)
+			continue;
+
 		cfg = irq_get_chip_data(irq);
 		if (!cfg)
 			continue;
Signature · 1 line
1.7.4.1