Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'x86-irq-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, acpi/irq: Define gsi_end when X86_IO_APIC is undefined
x86, irq: Kill io_apic_renumber_irq
x86, acpi/irq: Handle isa irqs that are not identity mapped to gsi's.
x86, ioapic: Simplify probe_nr_irqs_gsi.
x86, ioapic: Optimize pin_2_irq
x86, ioapic: Move nr_ioapic_registers calculation to mp_register_ioapic.
x86, ioapic: In mpparse use mp_register_ioapic
x86, ioapic: Teach mp_register_ioapic to compute a global gsi_end
x86, ioapic: Fix the types of gsi values
x86, ioapic: Fix io_apic_redir_entries to return the number of entries.
x86, ioapic: Only export mp_find_ioapic and mp_find_ioapic_pin in io_apic.h
x86, acpi/irq: Generalize mp_config_acpi_legacy_irqs
x86, acpi/irq: Fix acpi_sci_ioapic_setup so it has both bus_irq and gsi
x86, acpi/irq: pci device dev->irq is an isa irq not a gsi
x86, acpi/irq: Teach acpi_get_override_irq to take a gsi not an isa_irq
x86, acpi/irq: Introduce apci_isa_irq_to_gsi

+155 -169
+8
arch/ia64/kernel/acpi.c
··· 785 785 return 0; 786 786 } 787 787 788 + int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) 789 + { 790 + if (isa_irq >= 16) 791 + return -1; 792 + *gsi = isa_irq; 793 + return 0; 794 + } 795 + 788 796 /* 789 797 * ACPI based hotplug CPU support 790 798 */
+7 -6
arch/x86/include/asm/io_apic.h
··· 159 159 extern int io_apic_set_pci_routing(struct device *dev, int irq, 160 160 struct io_apic_irq_attr *irq_attr); 161 161 void setup_IO_APIC_irq_extra(u32 gsi); 162 - extern int (*ioapic_renumber_irq)(int ioapic, int irq); 163 162 extern void ioapic_init_mappings(void); 164 163 extern void ioapic_insert_resources(void); 165 164 ··· 179 180 extern void setup_ioapic_ids_from_mpc(void); 180 181 181 182 struct mp_ioapic_gsi{ 182 - int gsi_base; 183 - int gsi_end; 183 + u32 gsi_base; 184 + u32 gsi_end; 184 185 }; 185 186 extern struct mp_ioapic_gsi mp_gsi_routing[]; 186 - int mp_find_ioapic(int gsi); 187 - int mp_find_ioapic_pin(int ioapic, int gsi); 187 + extern u32 gsi_end; 188 + int mp_find_ioapic(u32 gsi); 189 + int mp_find_ioapic_pin(int ioapic, u32 gsi); 188 190 void __init mp_register_ioapic(int id, u32 address, u32 gsi_base); 189 191 extern void __init pre_init_apic_IRQ0(void); 190 192 ··· 197 197 static inline void ioapic_init_mappings(void) { } 198 198 static inline void ioapic_insert_resources(void) { } 199 199 static inline void probe_nr_irqs_gsi(void) { } 200 - static inline int mp_find_ioapic(int gsi) { return 0; } 200 + #define gsi_end (NR_IRQS_LEGACY - 1) 201 + static inline int mp_find_ioapic(u32 gsi) { return 0; } 201 202 202 203 struct io_apic_irq_attr; 203 204 static inline int io_apic_set_pci_routing(struct device *dev, int irq,
-10
arch/x86/include/asm/mpspec.h
··· 105 105 struct device; 106 106 extern int mp_register_gsi(struct device *dev, u32 gsi, int edge_level, 107 107 int active_high_low); 108 - extern int acpi_probe_gsi(void); 109 - #ifdef CONFIG_X86_IO_APIC 110 - extern int mp_find_ioapic(int gsi); 111 - extern int mp_find_ioapic_pin(int ioapic, int gsi); 112 - #endif 113 - #else /* !CONFIG_ACPI: */ 114 - static inline int acpi_probe_gsi(void) 115 - { 116 - return 0; 117 - } 118 108 #endif /* CONFIG_ACPI */ 119 109 120 110 #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
+85 -48
arch/x86/kernel/acpi/boot.c
··· 94 94 95 95 96 96 /* 97 + * ISA irqs by default are the first 16 gsis but can be 98 + * any gsi as specified by an interrupt source override. 99 + */ 100 + static u32 isa_irq_to_gsi[NR_IRQS_LEGACY] __read_mostly = { 101 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 102 + }; 103 + 104 + static unsigned int gsi_to_irq(unsigned int gsi) 105 + { 106 + unsigned int irq = gsi + NR_IRQS_LEGACY; 107 + unsigned int i; 108 + 109 + for (i = 0; i < NR_IRQS_LEGACY; i++) { 110 + if (isa_irq_to_gsi[i] == gsi) { 111 + return i; 112 + } 113 + } 114 + 115 + /* Provide an identity mapping of gsi == irq 116 + * except on truly weird platforms that have 117 + * non isa irqs in the first 16 gsis. 118 + */ 119 + if (gsi >= NR_IRQS_LEGACY) 120 + irq = gsi; 121 + else 122 + irq = gsi_end + 1 + gsi; 123 + 124 + return irq; 125 + } 126 + 127 + static u32 irq_to_gsi(int irq) 128 + { 129 + unsigned int gsi; 130 + 131 + if (irq < NR_IRQS_LEGACY) 132 + gsi = isa_irq_to_gsi[irq]; 133 + else if (irq <= gsi_end) 134 + gsi = irq; 135 + else if (irq <= (gsi_end + NR_IRQS_LEGACY)) 136 + gsi = irq - gsi_end; 137 + else 138 + gsi = 0xffffffff; 139 + 140 + return gsi; 141 + } 142 + 143 + /* 97 144 * Temporarily use the virtual area starting from FIX_IO_APIC_BASE_END, 98 145 * to map the target physical address. The problem is that set_fixmap() 99 146 * provides a single page, and it is possible that the page is not ··· 360 313 /* 361 314 * Parse Interrupt Source Override for the ACPI SCI 362 315 */ 363 - static void __init acpi_sci_ioapic_setup(u32 gsi, u16 polarity, u16 trigger) 316 + static void __init acpi_sci_ioapic_setup(u8 bus_irq, u16 polarity, u16 trigger, u32 gsi) 364 317 { 365 318 if (trigger == 0) /* compatible SCI trigger is level */ 366 319 trigger = 3; ··· 380 333 * If GSI is < 16, this will update its flags, 381 334 * else it will create a new mp_irqs[] entry. 382 335 */ 383 - mp_override_legacy_irq(gsi, polarity, trigger, gsi); 336 + mp_override_legacy_irq(bus_irq, polarity, trigger, gsi); 384 337 385 338 /* 386 339 * stash over-ride to indicate we've been here ··· 404 357 acpi_table_print_madt_entry(header); 405 358 406 359 if (intsrc->source_irq == acpi_gbl_FADT.sci_interrupt) { 407 - acpi_sci_ioapic_setup(intsrc->global_irq, 360 + acpi_sci_ioapic_setup(intsrc->source_irq, 408 361 intsrc->inti_flags & ACPI_MADT_POLARITY_MASK, 409 - (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2); 362 + (intsrc->inti_flags & ACPI_MADT_TRIGGER_MASK) >> 2, 363 + intsrc->global_irq); 410 364 return 0; 411 365 } 412 366 ··· 496 448 497 449 int acpi_gsi_to_irq(u32 gsi, unsigned int *irq) 498 450 { 499 - *irq = gsi; 451 + *irq = gsi_to_irq(gsi); 500 452 501 453 #ifdef CONFIG_X86_IO_APIC 502 454 if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) 503 455 setup_IO_APIC_irq_extra(gsi); 504 456 #endif 505 457 458 + return 0; 459 + } 460 + 461 + int acpi_isa_irq_to_gsi(unsigned isa_irq, u32 *gsi) 462 + { 463 + if (isa_irq >= 16) 464 + return -1; 465 + *gsi = irq_to_gsi(isa_irq); 506 466 return 0; 507 467 } 508 468 ··· 538 482 plat_gsi = mp_register_gsi(dev, gsi, trigger, polarity); 539 483 } 540 484 #endif 541 - irq = plat_gsi; 485 + irq = gsi_to_irq(plat_gsi); 542 486 543 487 return irq; 544 488 } ··· 923 867 extern int es7000_plat; 924 868 #endif 925 869 926 - int __init acpi_probe_gsi(void) 927 - { 928 - int idx; 929 - int gsi; 930 - int max_gsi = 0; 931 - 932 - if (acpi_disabled) 933 - return 0; 934 - 935 - if (!acpi_ioapic) 936 - return 0; 937 - 938 - max_gsi = 0; 939 - for (idx = 0; idx < nr_ioapics; idx++) { 940 - gsi = mp_gsi_routing[idx].gsi_end; 941 - 942 - if (gsi > max_gsi) 943 - max_gsi = gsi; 944 - } 945 - 946 - return max_gsi + 1; 947 - } 948 - 949 870 static void assign_to_mp_irq(struct mpc_intsrc *m, 950 871 struct mpc_intsrc *mp_irq) 951 872 { ··· 980 947 mp_irq.dstirq = pin; /* INTIN# */ 981 948 982 949 save_mp_irq(&mp_irq); 950 + 951 + isa_irq_to_gsi[bus_irq] = gsi; 983 952 } 984 953 985 954 void __init mp_config_acpi_legacy_irqs(void) 986 955 { 987 956 int i; 988 - int ioapic; 989 - unsigned int dstapic; 990 957 struct mpc_intsrc mp_irq; 991 958 992 959 #if defined (CONFIG_MCA) || defined (CONFIG_EISA) ··· 1007 974 #endif 1008 975 1009 976 /* 1010 - * Locate the IOAPIC that manages the ISA IRQs (0-15). 1011 - */ 1012 - ioapic = mp_find_ioapic(0); 1013 - if (ioapic < 0) 1014 - return; 1015 - dstapic = mp_ioapics[ioapic].apicid; 1016 - 1017 - /* 1018 977 * Use the default configuration for the IRQs 0-15. Unless 1019 978 * overridden by (MADT) interrupt source override entries. 1020 979 */ 1021 980 for (i = 0; i < 16; i++) { 981 + int ioapic, pin; 982 + unsigned int dstapic; 1022 983 int idx; 984 + u32 gsi; 985 + 986 + /* Locate the gsi that irq i maps to. */ 987 + if (acpi_isa_irq_to_gsi(i, &gsi)) 988 + continue; 989 + 990 + /* 991 + * Locate the IOAPIC that manages the ISA IRQ. 992 + */ 993 + ioapic = mp_find_ioapic(gsi); 994 + if (ioapic < 0) 995 + continue; 996 + pin = mp_find_ioapic_pin(ioapic, gsi); 997 + dstapic = mp_ioapics[ioapic].apicid; 1023 998 1024 999 for (idx = 0; idx < mp_irq_entries; idx++) { 1025 1000 struct mpc_intsrc *irq = mp_irqs + idx; ··· 1037 996 break; 1038 997 1039 998 /* Do we already have a mapping for this IOAPIC pin */ 1040 - if (irq->dstapic == dstapic && irq->dstirq == i) 999 + if (irq->dstapic == dstapic && irq->dstirq == pin) 1041 1000 break; 1042 1001 } 1043 1002 ··· 1052 1011 mp_irq.dstapic = dstapic; 1053 1012 mp_irq.irqtype = mp_INT; 1054 1013 mp_irq.srcbusirq = i; /* Identity mapped */ 1055 - mp_irq.dstirq = i; 1014 + mp_irq.dstirq = pin; 1056 1015 1057 1016 save_mp_irq(&mp_irq); 1058 1017 } ··· 1117 1076 1118 1077 ioapic_pin = mp_find_ioapic_pin(ioapic, gsi); 1119 1078 1120 - #ifdef CONFIG_X86_32 1121 - if (ioapic_renumber_irq) 1122 - gsi = ioapic_renumber_irq(ioapic, gsi); 1123 - #endif 1124 - 1125 1079 if (ioapic_pin > MP_MAX_IOAPIC_PIN) { 1126 1080 printk(KERN_ERR "Invalid reference to IOAPIC pin " 1127 1081 "%d-%d\n", mp_ioapics[ioapic].apicid, ··· 1130 1094 set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin, 1131 1095 trigger == ACPI_EDGE_SENSITIVE ? 0 : 1, 1132 1096 polarity == ACPI_ACTIVE_HIGH ? 0 : 1); 1133 - io_apic_set_pci_routing(dev, gsi, &irq_attr); 1097 + io_apic_set_pci_routing(dev, gsi_to_irq(gsi), &irq_attr); 1134 1098 1135 1099 return gsi; 1136 1100 } ··· 1190 1154 * pretend we got one so we can set the SCI flags. 1191 1155 */ 1192 1156 if (!acpi_sci_override_gsi) 1193 - acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0); 1157 + acpi_sci_ioapic_setup(acpi_gbl_FADT.sci_interrupt, 0, 0, 1158 + acpi_gbl_FADT.sci_interrupt); 1194 1159 1195 1160 /* Fill in identity legacy mappings where no override */ 1196 1161 mp_config_acpi_legacy_irqs();
-19
arch/x86/kernel/apic/es7000_32.c
··· 131 131 132 132 static unsigned int base; 133 133 134 - static int 135 - es7000_rename_gsi(int ioapic, int gsi) 136 - { 137 - if (es7000_plat == ES7000_ZORRO) 138 - return gsi; 139 - 140 - if (!base) { 141 - int i; 142 - for (i = 0; i < nr_ioapics; i++) 143 - base += nr_ioapic_registers[i]; 144 - } 145 - 146 - if (!ioapic && (gsi < 16)) 147 - gsi += base; 148 - 149 - return gsi; 150 - } 151 - 152 134 static int __cpuinit wakeup_secondary_cpu_via_mip(int cpu, unsigned long eip) 153 135 { 154 136 unsigned long vect = 0, psaival = 0; ··· 172 190 es7000_plat = ES7000_ZORRO; 173 191 else 174 192 es7000_plat = ES7000_CLASSIC; 175 - ioapic_renumber_irq = es7000_rename_gsi; 176 193 } 177 194 178 195 /*
+45 -54
arch/x86/kernel/apic/io_apic.c
··· 89 89 /* IO APIC gsi routing info */ 90 90 struct mp_ioapic_gsi mp_gsi_routing[MAX_IO_APICS]; 91 91 92 + /* The last gsi number used */ 93 + u32 gsi_end; 94 + 92 95 /* MP IRQ source entries */ 93 96 struct mpc_intsrc mp_irqs[MAX_IRQ_SOURCES]; 94 97 ··· 1016 1013 return MPBIOS_trigger(idx); 1017 1014 } 1018 1015 1019 - int (*ioapic_renumber_irq)(int ioapic, int irq); 1020 1016 static int pin_2_irq(int idx, int apic, int pin) 1021 1017 { 1022 - int irq, i; 1018 + int irq; 1023 1019 int bus = mp_irqs[idx].srcbus; 1024 1020 1025 1021 /* ··· 1030 1028 if (test_bit(bus, mp_bus_not_pci)) { 1031 1029 irq = mp_irqs[idx].srcbusirq; 1032 1030 } else { 1033 - /* 1034 - * PCI IRQs are mapped in order 1035 - */ 1036 - i = irq = 0; 1037 - while (i < apic) 1038 - irq += nr_ioapic_registers[i++]; 1039 - irq += pin; 1040 - /* 1041 - * For MPS mode, so far only needed by ES7000 platform 1042 - */ 1043 - if (ioapic_renumber_irq) 1044 - irq = ioapic_renumber_irq(apic, irq); 1031 + u32 gsi = mp_gsi_routing[apic].gsi_base + pin; 1032 + 1033 + if (gsi >= NR_IRQS_LEGACY) 1034 + irq = gsi; 1035 + else 1036 + irq = gsi_end + 1 + gsi; 1045 1037 } 1046 1038 1047 1039 #ifdef CONFIG_X86_32 ··· 1946 1950 1947 1951 void __init enable_IO_APIC(void) 1948 1952 { 1949 - union IO_APIC_reg_01 reg_01; 1950 1953 int i8259_apic, i8259_pin; 1951 1954 int apic; 1952 - unsigned long flags; 1953 - 1954 - /* 1955 - * The number of IO-APIC IRQ registers (== #pins): 1956 - */ 1957 - for (apic = 0; apic < nr_ioapics; apic++) { 1958 - raw_spin_lock_irqsave(&ioapic_lock, flags); 1959 - reg_01.raw = io_apic_read(apic, 1); 1960 - raw_spin_unlock_irqrestore(&ioapic_lock, flags); 1961 - nr_ioapic_registers[apic] = reg_01.bits.entries+1; 1962 - } 1963 1955 1964 1956 if (!legacy_pic->nr_legacy_irqs) 1965 1957 return; ··· 3842 3858 reg_01.raw = io_apic_read(ioapic, 1); 3843 3859 raw_spin_unlock_irqrestore(&ioapic_lock, flags); 3844 3860 3845 - return reg_01.bits.entries; 3861 + /* The register returns the maximum index redir index 3862 + * supported, which is one less than the total number of redir 3863 + * entries. 3864 + */ 3865 + return reg_01.bits.entries + 1; 3846 3866 } 3847 3867 3848 3868 void __init probe_nr_irqs_gsi(void) 3849 3869 { 3850 - int nr = 0; 3870 + int nr; 3851 3871 3852 - nr = acpi_probe_gsi(); 3853 - if (nr > nr_irqs_gsi) { 3872 + nr = gsi_end + 1 + NR_IRQS_LEGACY; 3873 + if (nr > nr_irqs_gsi) 3854 3874 nr_irqs_gsi = nr; 3855 - } else { 3856 - /* for acpi=off or acpi is not compiled in */ 3857 - int idx; 3858 - 3859 - nr = 0; 3860 - for (idx = 0; idx < nr_ioapics; idx++) 3861 - nr += io_apic_get_redir_entries(idx) + 1; 3862 - 3863 - if (nr > nr_irqs_gsi) 3864 - nr_irqs_gsi = nr; 3865 - } 3866 3875 3867 3876 printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); 3868 3877 } ··· 4062 4085 return reg_01.bits.version; 4063 4086 } 4064 4087 4065 - int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity) 4088 + int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity) 4066 4089 { 4067 - int i; 4090 + int ioapic, pin, idx; 4068 4091 4069 4092 if (skip_ioapic_setup) 4070 4093 return -1; 4071 4094 4072 - for (i = 0; i < mp_irq_entries; i++) 4073 - if (mp_irqs[i].irqtype == mp_INT && 4074 - mp_irqs[i].srcbusirq == bus_irq) 4075 - break; 4076 - if (i >= mp_irq_entries) 4095 + ioapic = mp_find_ioapic(gsi); 4096 + if (ioapic < 0) 4077 4097 return -1; 4078 4098 4079 - *trigger = irq_trigger(i); 4080 - *polarity = irq_polarity(i); 4099 + pin = mp_find_ioapic_pin(ioapic, gsi); 4100 + if (pin < 0) 4101 + return -1; 4102 + 4103 + idx = find_irq_entry(ioapic, pin, mp_INT); 4104 + if (idx < 0) 4105 + return -1; 4106 + 4107 + *trigger = irq_trigger(idx); 4108 + *polarity = irq_polarity(idx); 4081 4109 return 0; 4082 4110 } 4083 4111 ··· 4223 4241 } 4224 4242 } 4225 4243 4226 - int mp_find_ioapic(int gsi) 4244 + int mp_find_ioapic(u32 gsi) 4227 4245 { 4228 4246 int i = 0; 4229 4247 ··· 4238 4256 return -1; 4239 4257 } 4240 4258 4241 - int mp_find_ioapic_pin(int ioapic, int gsi) 4259 + int mp_find_ioapic_pin(int ioapic, u32 gsi) 4242 4260 { 4243 4261 if (WARN_ON(ioapic == -1)) 4244 4262 return -1; ··· 4266 4284 void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) 4267 4285 { 4268 4286 int idx = 0; 4287 + int entries; 4269 4288 4270 4289 if (bad_ioapic(address)) 4271 4290 return; ··· 4285 4302 * Build basic GSI lookup table to facilitate gsi->io_apic lookups 4286 4303 * and to prevent reprogramming of IOAPIC pins (PCI GSIs). 4287 4304 */ 4305 + entries = io_apic_get_redir_entries(idx); 4288 4306 mp_gsi_routing[idx].gsi_base = gsi_base; 4289 - mp_gsi_routing[idx].gsi_end = gsi_base + 4290 - io_apic_get_redir_entries(idx); 4307 + mp_gsi_routing[idx].gsi_end = gsi_base + entries - 1; 4308 + 4309 + /* 4310 + * The number of IO-APIC IRQ registers (== #pins): 4311 + */ 4312 + nr_ioapic_registers[idx] = entries; 4313 + 4314 + if (mp_gsi_routing[idx].gsi_end > gsi_end) 4315 + gsi_end = mp_gsi_routing[idx].gsi_end; 4291 4316 4292 4317 printk(KERN_INFO "IOAPIC[%d]: apic_id %d, version %d, address 0x%x, " 4293 4318 "GSI %d-%d\n", idx, mp_ioapics[idx].apicid,
+1 -24
arch/x86/kernel/mpparse.c
··· 115 115 printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); 116 116 } 117 117 118 - static int bad_ioapic(unsigned long address) 119 - { 120 - if (nr_ioapics >= MAX_IO_APICS) { 121 - printk(KERN_ERR "ERROR: Max # of I/O APICs (%d) exceeded " 122 - "(found %d)\n", MAX_IO_APICS, nr_ioapics); 123 - panic("Recompile kernel with bigger MAX_IO_APICS!\n"); 124 - } 125 - if (!address) { 126 - printk(KERN_ERR "WARNING: Bogus (zero) I/O APIC address" 127 - " found in table, skipping!\n"); 128 - return 1; 129 - } 130 - return 0; 131 - } 132 - 133 118 static void __init MP_ioapic_info(struct mpc_ioapic *m) 134 119 { 135 120 if (!(m->flags & MPC_APIC_USABLE)) ··· 123 138 printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n", 124 139 m->apicid, m->apicver, m->apicaddr); 125 140 126 - if (bad_ioapic(m->apicaddr)) 127 - return; 128 - 129 - mp_ioapics[nr_ioapics].apicaddr = m->apicaddr; 130 - mp_ioapics[nr_ioapics].apicid = m->apicid; 131 - mp_ioapics[nr_ioapics].type = m->type; 132 - mp_ioapics[nr_ioapics].apicver = m->apicver; 133 - mp_ioapics[nr_ioapics].flags = m->flags; 134 - nr_ioapics++; 141 + mp_register_ioapic(m->apicid, m->apicaddr, gsi_end + 1); 135 142 } 136 143 137 144 static void print_MP_intsrc_info(struct mpc_intsrc *m)
+1 -3
arch/x86/kernel/sfi.c
··· 81 81 #endif /* CONFIG_X86_LOCAL_APIC */ 82 82 83 83 #ifdef CONFIG_X86_IO_APIC 84 - static u32 gsi_base; 85 84 86 85 static int __init sfi_parse_ioapic(struct sfi_table_header *table) 87 86 { ··· 93 94 pentry = (struct sfi_apic_table_entry *)sb->pentry; 94 95 95 96 for (i = 0; i < num; i++) { 96 - mp_register_ioapic(i, pentry->phys_addr, gsi_base); 97 - gsi_base += io_apic_get_redir_entries(i); 97 + mp_register_ioapic(i, pentry->phys_addr, gsi_end + 1); 98 98 pentry++; 99 99 } 100 100
+5 -3
drivers/acpi/pci_irq.c
··· 401 401 * driver reported one, then use it. Exit in any case. 402 402 */ 403 403 if (gsi < 0) { 404 + u32 dev_gsi; 404 405 dev_warn(&dev->dev, "PCI INT %c: no GSI", pin_name(pin)); 405 406 /* Interrupt Line values above 0xF are forbidden */ 406 - if (dev->irq > 0 && (dev->irq <= 0xF)) { 407 - printk(" - using IRQ %d\n", dev->irq); 408 - acpi_register_gsi(&dev->dev, dev->irq, 407 + if (dev->irq > 0 && (dev->irq <= 0xF) && 408 + (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) { 409 + printk(" - using ISA IRQ %d\n", dev->irq); 410 + acpi_register_gsi(&dev->dev, dev_gsi, 409 411 ACPI_LEVEL_SENSITIVE, 410 412 ACPI_ACTIVE_LOW); 411 413 return 0;
+3 -2
include/linux/acpi.h
··· 116 116 117 117 int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); 118 118 int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 119 + int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi); 119 120 120 121 #ifdef CONFIG_X86_IO_APIC 121 - extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); 122 + extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity); 122 123 #else 123 - #define acpi_get_override_irq(bus, trigger, polarity) (-1) 124 + #define acpi_get_override_irq(gsi, trigger, polarity) (-1) 124 125 #endif 125 126 /* 126 127 * This function undoes the effect of one call to acpi_register_gsi().