diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2006-10-04 05:16:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:29 -0400 |
commit | f023d764cc6165eb4f1cad6b2b0882ce0660764a (patch) | |
tree | 6c905ec403aac146b21b12c5f89876d7faced6ce | |
parent | 550f2299ac8ffaba943cf211380d3a8d3fa75301 (diff) |
[PATCH] genirq: x86_64 irq: Kill gsi_irq_sharing
After raising the number of irqs the system supports this function is no
longer necessary.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Rajesh Shah <rajesh.shah@intel.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Protasevich, Natalie" <Natalie.Protasevich@UNISYS.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 4 | ||||
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 62 |
2 files changed, 1 insertions, 65 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 256fb532321e..92f79cdd9a48 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -62,8 +62,6 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return | |||
62 | #include <mach_mpparse.h> | 62 | #include <mach_mpparse.h> |
63 | #endif /* CONFIG_X86_LOCAL_APIC */ | 63 | #endif /* CONFIG_X86_LOCAL_APIC */ |
64 | 64 | ||
65 | static inline int gsi_irq_sharing(int gsi) { return gsi; } | ||
66 | |||
67 | #endif /* X86 */ | 65 | #endif /* X86 */ |
68 | 66 | ||
69 | #define BAD_MADT_ENTRY(entry, end) ( \ | 67 | #define BAD_MADT_ENTRY(entry, end) ( \ |
@@ -468,7 +466,7 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) | |||
468 | 466 | ||
469 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) | 467 | int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) |
470 | { | 468 | { |
471 | *irq = gsi_irq_sharing(gsi); | 469 | *irq = gsi; |
472 | return 0; | 470 | return 0; |
473 | } | 471 | } |
474 | 472 | ||
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 7d53f66394a7..e076a8fa3ac3 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -191,8 +191,6 @@ static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) | |||
191 | } | 191 | } |
192 | #endif | 192 | #endif |
193 | 193 | ||
194 | static u8 gsi_2_irq[NR_IRQ_VECTORS] = { [0 ... NR_IRQ_VECTORS-1] = 0xFF }; | ||
195 | |||
196 | /* | 194 | /* |
197 | * The common case is 1:1 IRQ<->pin mappings. Sometimes there are | 195 | * The common case is 1:1 IRQ<->pin mappings. Sometimes there are |
198 | * shared ISA-space IRQs, so we have to support them. We are super | 196 | * shared ISA-space IRQs, so we have to support them. We are super |
@@ -518,64 +516,6 @@ static inline int irq_trigger(int idx) | |||
518 | return MPBIOS_trigger(idx); | 516 | return MPBIOS_trigger(idx); |
519 | } | 517 | } |
520 | 518 | ||
521 | static int next_irq = 16; | ||
522 | |||
523 | /* | ||
524 | * gsi_irq_sharing -- Name overload! "irq" can be either a legacy IRQ | ||
525 | * in the range 0-15, a linux IRQ in the range 0-223, or a GSI number | ||
526 | * from ACPI, which can reach 800 in large boxen. | ||
527 | * | ||
528 | * Compact the sparse GSI space into a sequential IRQ series and reuse | ||
529 | * vectors if possible. | ||
530 | */ | ||
531 | int gsi_irq_sharing(int gsi) | ||
532 | { | ||
533 | int i, tries, vector; | ||
534 | |||
535 | BUG_ON(gsi >= NR_IRQ_VECTORS); | ||
536 | |||
537 | if (platform_legacy_irq(gsi)) | ||
538 | return gsi; | ||
539 | |||
540 | if (gsi_2_irq[gsi] != 0xFF) | ||
541 | return (int)gsi_2_irq[gsi]; | ||
542 | |||
543 | tries = NR_IRQS; | ||
544 | try_again: | ||
545 | vector = assign_irq_vector(gsi, TARGET_CPUS); | ||
546 | |||
547 | /* | ||
548 | * Sharing vectors means sharing IRQs, so scan irq_vectors for previous | ||
549 | * use of vector and if found, return that IRQ. However, we never want | ||
550 | * to share legacy IRQs, which usually have a different trigger mode | ||
551 | * than PCI. | ||
552 | */ | ||
553 | for (i = 0; i < NR_IRQS; i++) | ||
554 | if (IO_APIC_VECTOR(i) == vector) | ||
555 | break; | ||
556 | if (platform_legacy_irq(i)) { | ||
557 | if (--tries >= 0) { | ||
558 | IO_APIC_VECTOR(i) = 0; | ||
559 | goto try_again; | ||
560 | } | ||
561 | panic("gsi_irq_sharing: didn't find an IRQ using vector 0x%02X for GSI %d", vector, gsi); | ||
562 | } | ||
563 | if (i < NR_IRQS) { | ||
564 | gsi_2_irq[gsi] = i; | ||
565 | printk(KERN_INFO "GSI %d sharing vector 0x%02X and IRQ %d\n", | ||
566 | gsi, vector, i); | ||
567 | return i; | ||
568 | } | ||
569 | |||
570 | i = next_irq++; | ||
571 | BUG_ON(i >= NR_IRQS); | ||
572 | gsi_2_irq[gsi] = i; | ||
573 | IO_APIC_VECTOR(i) = vector; | ||
574 | printk(KERN_INFO "GSI %d assigned vector 0x%02X and IRQ %d\n", | ||
575 | gsi, vector, i); | ||
576 | return i; | ||
577 | } | ||
578 | |||
579 | static int pin_2_irq(int idx, int apic, int pin) | 519 | static int pin_2_irq(int idx, int apic, int pin) |
580 | { | 520 | { |
581 | int irq, i; | 521 | int irq, i; |
@@ -597,7 +537,6 @@ static int pin_2_irq(int idx, int apic, int pin) | |||
597 | while (i < apic) | 537 | while (i < apic) |
598 | irq += nr_ioapic_registers[i++]; | 538 | irq += nr_ioapic_registers[i++]; |
599 | irq += pin; | 539 | irq += pin; |
600 | irq = gsi_irq_sharing(irq); | ||
601 | } | 540 | } |
602 | BUG_ON(irq >= NR_IRQS); | 541 | BUG_ON(irq >= NR_IRQS); |
603 | return irq; | 542 | return irq; |
@@ -1872,7 +1811,6 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int p | |||
1872 | return -EINVAL; | 1811 | return -EINVAL; |
1873 | } | 1812 | } |
1874 | 1813 | ||
1875 | irq = gsi_irq_sharing(irq); | ||
1876 | /* | 1814 | /* |
1877 | * IRQs < 16 are already in the irq_2_pin[] map | 1815 | * IRQs < 16 are already in the irq_2_pin[] map |
1878 | */ | 1816 | */ |