Skip to content

Commit

Permalink
x86/ioapic: Use legacy_pic to set correct gsi-irq mapping
Browse files Browse the repository at this point in the history
Using compile time NR_LEGACY_IRQS causes the wrong gsi-irq
mapping on non-PC platforms, such as Moorestown. This patch uses
legacy_pic abstraction to set the correct number of legacy
interrupts at runtime. For Moorestown, nr_legacy_irqs = 0. We
have 1:1 mapping for gsi-irq even within the legacy irq range.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Dirk Brandewie <dirk.brandewie@gmail.com>
Link: http://lkml.kernel.org/n/tip-kzvj4xp9tmicuoqoh2w05iay@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Jacob Pan authored and Ingo Molnar committed Jan 26, 2012
1 parent 87f71ae commit b3eea29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kernel/apic/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ static int pin_2_irq(int idx, int apic, int pin)
} else {
u32 gsi = gsi_cfg->gsi_base + pin;

if (gsi >= NR_IRQS_LEGACY)
if (gsi >= legacy_pic->nr_legacy_irqs)
irq = gsi;
else
irq = gsi_top + gsi;
Expand Down Expand Up @@ -3610,7 +3610,7 @@ static void __init probe_nr_irqs_gsi(void)
{
int nr;

nr = gsi_top + NR_IRQS_LEGACY;
nr = gsi_top + legacy_pic->nr_legacy_irqs;
if (nr > nr_irqs_gsi)
nr_irqs_gsi = nr;

Expand Down

0 comments on commit b3eea29

Please sign in to comment.