diff options
Diffstat (limited to 'arch/x86_64/kernel/io_apic.c')
-rw-r--r-- | arch/x86_64/kernel/io_apic.c | 92 |
1 files changed, 22 insertions, 70 deletions
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 8bbff64c20d7..a1412042b918 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -308,7 +308,7 @@ static int __init find_isa_irq_pin(int irq, int type) | |||
308 | for (i = 0; i < mp_irq_entries; i++) { | 308 | for (i = 0; i < mp_irq_entries; i++) { |
309 | int lbus = mp_irqs[i].mpc_srcbus; | 309 | int lbus = mp_irqs[i].mpc_srcbus; |
310 | 310 | ||
311 | if (mp_bus_id_to_type[lbus] == MP_BUS_ISA && | 311 | if (test_bit(lbus, mp_bus_not_pci) && |
312 | (mp_irqs[i].mpc_irqtype == type) && | 312 | (mp_irqs[i].mpc_irqtype == type) && |
313 | (mp_irqs[i].mpc_srcbusirq == irq)) | 313 | (mp_irqs[i].mpc_srcbusirq == irq)) |
314 | 314 | ||
@@ -324,7 +324,7 @@ static int __init find_isa_irq_apic(int irq, int type) | |||
324 | for (i = 0; i < mp_irq_entries; i++) { | 324 | for (i = 0; i < mp_irq_entries; i++) { |
325 | int lbus = mp_irqs[i].mpc_srcbus; | 325 | int lbus = mp_irqs[i].mpc_srcbus; |
326 | 326 | ||
327 | if ((mp_bus_id_to_type[lbus] == MP_BUS_ISA) && | 327 | if (test_bit(lbus, mp_bus_not_pci) && |
328 | (mp_irqs[i].mpc_irqtype == type) && | 328 | (mp_irqs[i].mpc_irqtype == type) && |
329 | (mp_irqs[i].mpc_srcbusirq == irq)) | 329 | (mp_irqs[i].mpc_srcbusirq == irq)) |
330 | break; | 330 | break; |
@@ -364,7 +364,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin) | |||
364 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) | 364 | mp_irqs[i].mpc_dstapic == MP_APIC_ALL) |
365 | break; | 365 | break; |
366 | 366 | ||
367 | if ((mp_bus_id_to_type[lbus] == MP_BUS_PCI) && | 367 | if (!test_bit(lbus, mp_bus_not_pci) && |
368 | !mp_irqs[i].mpc_irqtype && | 368 | !mp_irqs[i].mpc_irqtype && |
369 | (bus == lbus) && | 369 | (bus == lbus) && |
370 | (slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) { | 370 | (slot == ((mp_irqs[i].mpc_srcbusirq >> 2) & 0x1f))) { |
@@ -410,28 +410,11 @@ static int __init MPBIOS_polarity(int idx) | |||
410 | switch (mp_irqs[idx].mpc_irqflag & 3) | 410 | switch (mp_irqs[idx].mpc_irqflag & 3) |
411 | { | 411 | { |
412 | case 0: /* conforms, ie. bus-type dependent polarity */ | 412 | case 0: /* conforms, ie. bus-type dependent polarity */ |
413 | { | 413 | if (test_bit(bus, mp_bus_not_pci)) |
414 | switch (mp_bus_id_to_type[bus]) | 414 | polarity = default_ISA_polarity(idx); |
415 | { | 415 | else |
416 | case MP_BUS_ISA: /* ISA pin */ | 416 | polarity = default_PCI_polarity(idx); |
417 | { | ||
418 | polarity = default_ISA_polarity(idx); | ||
419 | break; | ||
420 | } | ||
421 | case MP_BUS_PCI: /* PCI pin */ | ||
422 | { | ||
423 | polarity = default_PCI_polarity(idx); | ||
424 | break; | ||
425 | } | ||
426 | default: | ||
427 | { | ||
428 | printk(KERN_WARNING "broken BIOS!!\n"); | ||
429 | polarity = 1; | ||
430 | break; | ||
431 | } | ||
432 | } | ||
433 | break; | 417 | break; |
434 | } | ||
435 | case 1: /* high active */ | 418 | case 1: /* high active */ |
436 | { | 419 | { |
437 | polarity = 0; | 420 | polarity = 0; |
@@ -469,28 +452,11 @@ static int MPBIOS_trigger(int idx) | |||
469 | switch ((mp_irqs[idx].mpc_irqflag>>2) & 3) | 452 | switch ((mp_irqs[idx].mpc_irqflag>>2) & 3) |
470 | { | 453 | { |
471 | case 0: /* conforms, ie. bus-type dependent */ | 454 | case 0: /* conforms, ie. bus-type dependent */ |
472 | { | 455 | if (test_bit(bus, mp_bus_not_pci)) |
473 | switch (mp_bus_id_to_type[bus]) | 456 | trigger = default_ISA_trigger(idx); |
474 | { | 457 | else |
475 | case MP_BUS_ISA: /* ISA pin */ | 458 | trigger = default_PCI_trigger(idx); |
476 | { | ||
477 | trigger = default_ISA_trigger(idx); | ||
478 | break; | ||
479 | } | ||
480 | case MP_BUS_PCI: /* PCI pin */ | ||
481 | { | ||
482 | trigger = default_PCI_trigger(idx); | ||
483 | break; | ||
484 | } | ||
485 | default: | ||
486 | { | ||
487 | printk(KERN_WARNING "broken BIOS!!\n"); | ||
488 | trigger = 1; | ||
489 | break; | ||
490 | } | ||
491 | } | ||
492 | break; | 459 | break; |
493 | } | ||
494 | case 1: /* edge */ | 460 | case 1: /* edge */ |
495 | { | 461 | { |
496 | trigger = 0; | 462 | trigger = 0; |
@@ -596,31 +562,17 @@ static int pin_2_irq(int idx, int apic, int pin) | |||
596 | if (mp_irqs[idx].mpc_dstirq != pin) | 562 | if (mp_irqs[idx].mpc_dstirq != pin) |
597 | printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); | 563 | printk(KERN_ERR "broken BIOS or MPTABLE parser, ayiee!!\n"); |
598 | 564 | ||
599 | switch (mp_bus_id_to_type[bus]) | 565 | if (test_bit(bus, mp_bus_not_pci)) { |
600 | { | 566 | irq = mp_irqs[idx].mpc_srcbusirq; |
601 | case MP_BUS_ISA: /* ISA pin */ | 567 | } else { |
602 | { | 568 | /* |
603 | irq = mp_irqs[idx].mpc_srcbusirq; | 569 | * PCI IRQs are mapped in order |
604 | break; | 570 | */ |
605 | } | 571 | i = irq = 0; |
606 | case MP_BUS_PCI: /* PCI pin */ | 572 | while (i < apic) |
607 | { | 573 | irq += nr_ioapic_registers[i++]; |
608 | /* | 574 | irq += pin; |
609 | * PCI IRQs are mapped in order | 575 | irq = gsi_irq_sharing(irq); |
610 | */ | ||
611 | i = irq = 0; | ||
612 | while (i < apic) | ||
613 | irq += nr_ioapic_registers[i++]; | ||
614 | irq += pin; | ||
615 | irq = gsi_irq_sharing(irq); | ||
616 | break; | ||
617 | } | ||
618 | default: | ||
619 | { | ||
620 | printk(KERN_ERR "unknown bus type %d.\n",bus); | ||
621 | irq = 0; | ||
622 | break; | ||
623 | } | ||
624 | } | 576 | } |
625 | BUG_ON(irq >= NR_IRQS); | 577 | BUG_ON(irq >= NR_IRQS); |
626 | return irq; | 578 | return irq; |