Skip to content

Commit

Permalink
[PATCH] x86_64: avoid wasting IRQs patch update
Browse files Browse the repository at this point in the history
The patch adds boundary check for the MAX_GSI_NUM.  Same as the update for
i386, the patch addresses a problem with ACPI SCI IRQ.  The patch corrects
the code such that SCI IRQ is skipped and duplicate entry is avoided.  The
VIA chipset uses 4-bit IRQ register for internal interrupt routing, and
therefore cannot handle IRQ numbers assigned to its devices.  The patch
corrects this problem by allowing PCI IRQs below 16.

Signed-off-by: Natalie Protasevich <Natalie.Protasevich@unisys.com>
Acked-by: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Natalie.Protasevich@unisys.com authored and Linus Torvalds committed Jul 30, 2005
1 parent c70f5d6 commit 6a1caa2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions arch/x86_64/kernel/mpparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,8 +970,21 @@ int mp_register_gsi(u32 gsi, int edge_level, int active_high_low)
* due to unused I/O APIC pins.
*/
int irq = gsi;
gsi = pci_irq++;
gsi_to_irq[irq] = gsi;
if (gsi < MAX_GSI_NUM) {
if (gsi > 15)
gsi = pci_irq++;
#ifdef CONFIG_ACPI_BUS
/*
* Don't assign IRQ used by ACPI SCI
*/
if (gsi == acpi_fadt.sci_int)
gsi = pci_irq++;
#endif
gsi_to_irq[irq] = gsi;
} else {
printk(KERN_ERR "GSI %u is too high\n", gsi);
return gsi;
}
}

io_apic_set_pci_routing(ioapic, ioapic_pin, gsi,
Expand Down

0 comments on commit 6a1caa2

Please sign in to comment.