aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/pci/irq.c')
-rw-r--r--arch/x86/pci/irq.c268
1 files changed, 132 insertions, 136 deletions
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 0908fca901bf..f0859de23e20 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -11,8 +11,8 @@
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/dmi.h> 13#include <linux/dmi.h>
14#include <asm/io.h> 14#include <linux/io.h>
15#include <asm/smp.h> 15#include <linux/smp.h>
16#include <asm/io_apic.h> 16#include <asm/io_apic.h>
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/acpi.h> 18#include <linux/acpi.h>
@@ -61,7 +61,7 @@ void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
61 * and perform checksum verification. 61 * and perform checksum verification.
62 */ 62 */
63 63
64static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) 64static inline struct irq_routing_table *pirq_check_routing_table(u8 *addr)
65{ 65{
66 struct irq_routing_table *rt; 66 struct irq_routing_table *rt;
67 int i; 67 int i;
@@ -74,7 +74,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr)
74 rt->size < sizeof(struct irq_routing_table)) 74 rt->size < sizeof(struct irq_routing_table))
75 return NULL; 75 return NULL;
76 sum = 0; 76 sum = 0;
77 for (i=0; i < rt->size; i++) 77 for (i = 0; i < rt->size; i++)
78 sum += addr[i]; 78 sum += addr[i];
79 if (!sum) { 79 if (!sum) {
80 DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); 80 DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt);
@@ -100,7 +100,7 @@ static struct irq_routing_table * __init pirq_find_routing_table(void)
100 return rt; 100 return rt;
101 printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n"); 101 printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n");
102 } 102 }
103 for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { 103 for (addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) {
104 rt = pirq_check_routing_table(addr); 104 rt = pirq_check_routing_table(addr);
105 if (rt) 105 if (rt)
106 return rt; 106 return rt;
@@ -122,20 +122,20 @@ static void __init pirq_peer_trick(void)
122 struct irq_info *e; 122 struct irq_info *e;
123 123
124 memset(busmap, 0, sizeof(busmap)); 124 memset(busmap, 0, sizeof(busmap));
125 for(i=0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { 125 for (i = 0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) {
126 e = &rt->slots[i]; 126 e = &rt->slots[i];
127#ifdef DEBUG 127#ifdef DEBUG
128 { 128 {
129 int j; 129 int j;
130 DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); 130 DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot);
131 for(j=0; j<4; j++) 131 for (j = 0; j < 4; j++)
132 DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); 132 DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap);
133 DBG("\n"); 133 DBG("\n");
134 } 134 }
135#endif 135#endif
136 busmap[e->bus] = 1; 136 busmap[e->bus] = 1;
137 } 137 }
138 for(i = 1; i < 256; i++) { 138 for (i = 1; i < 256; i++) {
139 int node; 139 int node;
140 if (!busmap[i] || pci_find_bus(0, i)) 140 if (!busmap[i] || pci_find_bus(0, i))
141 continue; 141 continue;
@@ -285,7 +285,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
285 static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; 285 static const unsigned char pirqmap[4] = { 1, 0, 2, 3 };
286 286
287 WARN_ON_ONCE(pirq > 4); 287 WARN_ON_ONCE(pirq > 4);
288 return read_config_nybble(router,0x43, pirqmap[pirq-1]); 288 return read_config_nybble(router, 0x43, pirqmap[pirq-1]);
289} 289}
290 290
291static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) 291static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
@@ -314,7 +314,7 @@ static int pirq_opti_set(struct pci_dev *router, struct pci_dev *dev, int pirq,
314 314
315/* 315/*
316 * Cyrix: nibble offset 0x5C 316 * Cyrix: nibble offset 0x5C
317 * 0x5C bits 7:4 is INTB bits 3:0 is INTA 317 * 0x5C bits 7:4 is INTB bits 3:0 is INTA
318 * 0x5D bits 7:4 is INTD bits 3:0 is INTC 318 * 0x5D bits 7:4 is INTD bits 3:0 is INTC
319 */ 319 */
320static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) 320static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq)
@@ -350,7 +350,7 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq,
350 * Apparently there are systems implementing PCI routing table using 350 * Apparently there are systems implementing PCI routing table using
351 * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D. 351 * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D.
352 * We try our best to handle both link mappings. 352 * We try our best to handle both link mappings.
353 * 353 *
354 * Currently (2003-05-21) it appears most SiS chipsets follow the 354 * Currently (2003-05-21) it appears most SiS chipsets follow the
355 * definition of routing registers from the SiS-5595 southbridge. 355 * definition of routing registers from the SiS-5595 southbridge.
356 * According to the SiS 5595 datasheets the revision id's of the 356 * According to the SiS 5595 datasheets the revision id's of the
@@ -370,7 +370,7 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq,
370 * 370 *
371 * 0x62: USBIRQ: 371 * 0x62: USBIRQ:
372 * bit 6 OHCI function disabled (0), enabled (1) 372 * bit 6 OHCI function disabled (0), enabled (1)
373 * 373 *
374 * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved 374 * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved
375 * 375 *
376 * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved 376 * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved
@@ -487,9 +487,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq
487 u8 irq; 487 u8 irq;
488 irq = 0; 488 irq = 0;
489 if (pirq <= 4) 489 if (pirq <= 4)
490 {
491 irq = read_config_nybble(router, 0x56, pirq - 1); 490 irq = read_config_nybble(router, 0x56, pirq - 1);
492 }
493 printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", 491 printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n",
494 dev->vendor, dev->device, pirq, irq); 492 dev->vendor, dev->device, pirq, irq);
495 return irq; 493 return irq;
@@ -497,12 +495,10 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq
497 495
498static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) 496static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq)
499{ 497{
500 printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", 498 printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n",
501 dev->vendor, dev->device, pirq, irq); 499 dev->vendor, dev->device, pirq, irq);
502 if (pirq <= 4) 500 if (pirq <= 4)
503 {
504 write_config_nybble(router, 0x56, pirq - 1, irq); 501 write_config_nybble(router, 0x56, pirq - 1, irq);
505 }
506 return 1; 502 return 1;
507} 503}
508 504
@@ -549,50 +545,49 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route
549 if (pci_dev_present(pirq_440gx)) 545 if (pci_dev_present(pirq_440gx))
550 return 0; 546 return 0;
551 547
552 switch(device) 548 switch (device) {
553 { 549 case PCI_DEVICE_ID_INTEL_82371FB_0:
554 case PCI_DEVICE_ID_INTEL_82371FB_0: 550 case PCI_DEVICE_ID_INTEL_82371SB_0:
555 case PCI_DEVICE_ID_INTEL_82371SB_0: 551 case PCI_DEVICE_ID_INTEL_82371AB_0:
556 case PCI_DEVICE_ID_INTEL_82371AB_0: 552 case PCI_DEVICE_ID_INTEL_82371MX:
557 case PCI_DEVICE_ID_INTEL_82371MX: 553 case PCI_DEVICE_ID_INTEL_82443MX_0:
558 case PCI_DEVICE_ID_INTEL_82443MX_0: 554 case PCI_DEVICE_ID_INTEL_82801AA_0:
559 case PCI_DEVICE_ID_INTEL_82801AA_0: 555 case PCI_DEVICE_ID_INTEL_82801AB_0:
560 case PCI_DEVICE_ID_INTEL_82801AB_0: 556 case PCI_DEVICE_ID_INTEL_82801BA_0:
561 case PCI_DEVICE_ID_INTEL_82801BA_0: 557 case PCI_DEVICE_ID_INTEL_82801BA_10:
562 case PCI_DEVICE_ID_INTEL_82801BA_10: 558 case PCI_DEVICE_ID_INTEL_82801CA_0:
563 case PCI_DEVICE_ID_INTEL_82801CA_0: 559 case PCI_DEVICE_ID_INTEL_82801CA_12:
564 case PCI_DEVICE_ID_INTEL_82801CA_12: 560 case PCI_DEVICE_ID_INTEL_82801DB_0:
565 case PCI_DEVICE_ID_INTEL_82801DB_0: 561 case PCI_DEVICE_ID_INTEL_82801E_0:
566 case PCI_DEVICE_ID_INTEL_82801E_0: 562 case PCI_DEVICE_ID_INTEL_82801EB_0:
567 case PCI_DEVICE_ID_INTEL_82801EB_0: 563 case PCI_DEVICE_ID_INTEL_ESB_1:
568 case PCI_DEVICE_ID_INTEL_ESB_1: 564 case PCI_DEVICE_ID_INTEL_ICH6_0:
569 case PCI_DEVICE_ID_INTEL_ICH6_0: 565 case PCI_DEVICE_ID_INTEL_ICH6_1:
570 case PCI_DEVICE_ID_INTEL_ICH6_1: 566 case PCI_DEVICE_ID_INTEL_ICH7_0:
571 case PCI_DEVICE_ID_INTEL_ICH7_0: 567 case PCI_DEVICE_ID_INTEL_ICH7_1:
572 case PCI_DEVICE_ID_INTEL_ICH7_1: 568 case PCI_DEVICE_ID_INTEL_ICH7_30:
573 case PCI_DEVICE_ID_INTEL_ICH7_30: 569 case PCI_DEVICE_ID_INTEL_ICH7_31:
574 case PCI_DEVICE_ID_INTEL_ICH7_31: 570 case PCI_DEVICE_ID_INTEL_ESB2_0:
575 case PCI_DEVICE_ID_INTEL_ESB2_0: 571 case PCI_DEVICE_ID_INTEL_ICH8_0:
576 case PCI_DEVICE_ID_INTEL_ICH8_0: 572 case PCI_DEVICE_ID_INTEL_ICH8_1:
577 case PCI_DEVICE_ID_INTEL_ICH8_1: 573 case PCI_DEVICE_ID_INTEL_ICH8_2:
578 case PCI_DEVICE_ID_INTEL_ICH8_2: 574 case PCI_DEVICE_ID_INTEL_ICH8_3:
579 case PCI_DEVICE_ID_INTEL_ICH8_3: 575 case PCI_DEVICE_ID_INTEL_ICH8_4:
580 case PCI_DEVICE_ID_INTEL_ICH8_4: 576 case PCI_DEVICE_ID_INTEL_ICH9_0:
581 case PCI_DEVICE_ID_INTEL_ICH9_0: 577 case PCI_DEVICE_ID_INTEL_ICH9_1:
582 case PCI_DEVICE_ID_INTEL_ICH9_1: 578 case PCI_DEVICE_ID_INTEL_ICH9_2:
583 case PCI_DEVICE_ID_INTEL_ICH9_2: 579 case PCI_DEVICE_ID_INTEL_ICH9_3:
584 case PCI_DEVICE_ID_INTEL_ICH9_3: 580 case PCI_DEVICE_ID_INTEL_ICH9_4:
585 case PCI_DEVICE_ID_INTEL_ICH9_4: 581 case PCI_DEVICE_ID_INTEL_ICH9_5:
586 case PCI_DEVICE_ID_INTEL_ICH9_5: 582 case PCI_DEVICE_ID_INTEL_TOLAPAI_0:
587 case PCI_DEVICE_ID_INTEL_TOLAPAI_0: 583 case PCI_DEVICE_ID_INTEL_ICH10_0:
588 case PCI_DEVICE_ID_INTEL_ICH10_0: 584 case PCI_DEVICE_ID_INTEL_ICH10_1:
589 case PCI_DEVICE_ID_INTEL_ICH10_1: 585 case PCI_DEVICE_ID_INTEL_ICH10_2:
590 case PCI_DEVICE_ID_INTEL_ICH10_2: 586 case PCI_DEVICE_ID_INTEL_ICH10_3:
591 case PCI_DEVICE_ID_INTEL_ICH10_3: 587 r->name = "PIIX/ICH";
592 r->name = "PIIX/ICH"; 588 r->get = pirq_piix_get;
593 r->get = pirq_piix_get; 589 r->set = pirq_piix_set;
594 r->set = pirq_piix_set; 590 return 1;
595 return 1;
596 } 591 }
597 return 0; 592 return 0;
598} 593}
@@ -606,7 +601,7 @@ static __init int via_router_probe(struct irq_router *r,
606 * workarounds for some buggy BIOSes 601 * workarounds for some buggy BIOSes
607 */ 602 */
608 if (device == PCI_DEVICE_ID_VIA_82C586_0) { 603 if (device == PCI_DEVICE_ID_VIA_82C586_0) {
609 switch(router->device) { 604 switch (router->device) {
610 case PCI_DEVICE_ID_VIA_82C686: 605 case PCI_DEVICE_ID_VIA_82C686:
611 /* 606 /*
612 * Asus k7m bios wrongly reports 82C686A 607 * Asus k7m bios wrongly reports 82C686A
@@ -621,10 +616,17 @@ static __init int via_router_probe(struct irq_router *r,
621 */ 616 */
622 device = PCI_DEVICE_ID_VIA_8235; 617 device = PCI_DEVICE_ID_VIA_8235;
623 break; 618 break;
619 case PCI_DEVICE_ID_VIA_8237:
620 /**
621 * Asus a7v600 bios wrongly reports 8237
622 * as 586-compatible
623 */
624 device = PCI_DEVICE_ID_VIA_8237;
625 break;
624 } 626 }
625 } 627 }
626 628
627 switch(device) { 629 switch (device) {
628 case PCI_DEVICE_ID_VIA_82C586_0: 630 case PCI_DEVICE_ID_VIA_82C586_0:
629 r->name = "VIA"; 631 r->name = "VIA";
630 r->get = pirq_via586_get; 632 r->get = pirq_via586_get;
@@ -647,13 +649,12 @@ static __init int via_router_probe(struct irq_router *r,
647 649
648static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 650static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
649{ 651{
650 switch(device) 652 switch (device) {
651 { 653 case PCI_DEVICE_ID_VLSI_82C534:
652 case PCI_DEVICE_ID_VLSI_82C534: 654 r->name = "VLSI 82C534";
653 r->name = "VLSI 82C534"; 655 r->get = pirq_vlsi_get;
654 r->get = pirq_vlsi_get; 656 r->set = pirq_vlsi_set;
655 r->set = pirq_vlsi_set; 657 return 1;
656 return 1;
657 } 658 }
658 return 0; 659 return 0;
659} 660}
@@ -661,14 +662,13 @@ static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router
661 662
662static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 663static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
663{ 664{
664 switch(device) 665 switch (device) {
665 { 666 case PCI_DEVICE_ID_SERVERWORKS_OSB4:
666 case PCI_DEVICE_ID_SERVERWORKS_OSB4: 667 case PCI_DEVICE_ID_SERVERWORKS_CSB5:
667 case PCI_DEVICE_ID_SERVERWORKS_CSB5: 668 r->name = "ServerWorks";
668 r->name = "ServerWorks"; 669 r->get = pirq_serverworks_get;
669 r->get = pirq_serverworks_get; 670 r->set = pirq_serverworks_set;
670 r->set = pirq_serverworks_set; 671 return 1;
671 return 1;
672 } 672 }
673 return 0; 673 return 0;
674} 674}
@@ -677,7 +677,7 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router,
677{ 677{
678 if (device != PCI_DEVICE_ID_SI_503) 678 if (device != PCI_DEVICE_ID_SI_503)
679 return 0; 679 return 0;
680 680
681 r->name = "SIS"; 681 r->name = "SIS";
682 r->get = pirq_sis_get; 682 r->get = pirq_sis_get;
683 r->set = pirq_sis_set; 683 r->set = pirq_sis_set;
@@ -686,47 +686,43 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router,
686 686
687static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 687static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
688{ 688{
689 switch(device) 689 switch (device) {
690 { 690 case PCI_DEVICE_ID_CYRIX_5520:
691 case PCI_DEVICE_ID_CYRIX_5520: 691 r->name = "NatSemi";
692 r->name = "NatSemi"; 692 r->get = pirq_cyrix_get;
693 r->get = pirq_cyrix_get; 693 r->set = pirq_cyrix_set;
694 r->set = pirq_cyrix_set; 694 return 1;
695 return 1;
696 } 695 }
697 return 0; 696 return 0;
698} 697}
699 698
700static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 699static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
701{ 700{
702 switch(device) 701 switch (device) {
703 { 702 case PCI_DEVICE_ID_OPTI_82C700:
704 case PCI_DEVICE_ID_OPTI_82C700: 703 r->name = "OPTI";
705 r->name = "OPTI"; 704 r->get = pirq_opti_get;
706 r->get = pirq_opti_get; 705 r->set = pirq_opti_set;
707 r->set = pirq_opti_set; 706 return 1;
708 return 1;
709 } 707 }
710 return 0; 708 return 0;
711} 709}
712 710
713static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 711static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
714{ 712{
715 switch(device) 713 switch (device) {
716 { 714 case PCI_DEVICE_ID_ITE_IT8330G_0:
717 case PCI_DEVICE_ID_ITE_IT8330G_0: 715 r->name = "ITE";
718 r->name = "ITE"; 716 r->get = pirq_ite_get;
719 r->get = pirq_ite_get; 717 r->set = pirq_ite_set;
720 r->set = pirq_ite_set; 718 return 1;
721 return 1;
722 } 719 }
723 return 0; 720 return 0;
724} 721}
725 722
726static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 723static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
727{ 724{
728 switch(device) 725 switch (device) {
729 {
730 case PCI_DEVICE_ID_AL_M1533: 726 case PCI_DEVICE_ID_AL_M1533:
731 case PCI_DEVICE_ID_AL_M1563: 727 case PCI_DEVICE_ID_AL_M1563:
732 printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); 728 printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n");
@@ -740,25 +736,24 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router,
740 736
741static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 737static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
742{ 738{
743 switch(device) 739 switch (device) {
744 { 740 case PCI_DEVICE_ID_AMD_VIPER_740B:
745 case PCI_DEVICE_ID_AMD_VIPER_740B: 741 r->name = "AMD756";
746 r->name = "AMD756"; 742 break;
747 break; 743 case PCI_DEVICE_ID_AMD_VIPER_7413:
748 case PCI_DEVICE_ID_AMD_VIPER_7413: 744 r->name = "AMD766";
749 r->name = "AMD766"; 745 break;
750 break; 746 case PCI_DEVICE_ID_AMD_VIPER_7443:
751 case PCI_DEVICE_ID_AMD_VIPER_7443: 747 r->name = "AMD768";
752 r->name = "AMD768"; 748 break;
753 break; 749 default:
754 default: 750 return 0;
755 return 0;
756 } 751 }
757 r->get = pirq_amd756_get; 752 r->get = pirq_amd756_get;
758 r->set = pirq_amd756_set; 753 r->set = pirq_amd756_set;
759 return 1; 754 return 1;
760} 755}
761 756
762static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) 757static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)
763{ 758{
764 switch (device) { 759 switch (device) {
@@ -800,7 +795,7 @@ static struct pci_dev *pirq_router_dev;
800 * FIXME: should we have an option to say "generic for 795 * FIXME: should we have an option to say "generic for
801 * chipset" ? 796 * chipset" ?
802 */ 797 */
803 798
804static void __init pirq_find_router(struct irq_router *r) 799static void __init pirq_find_router(struct irq_router *r)
805{ 800{
806 struct irq_routing_table *rt = pirq_table; 801 struct irq_routing_table *rt = pirq_table;
@@ -819,7 +814,7 @@ static void __init pirq_find_router(struct irq_router *r)
819 r->name = "default"; 814 r->name = "default";
820 r->get = NULL; 815 r->get = NULL;
821 r->set = NULL; 816 r->set = NULL;
822 817
823 DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", 818 DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n",
824 rt->rtr_vendor, rt->rtr_device); 819 rt->rtr_vendor, rt->rtr_device);
825 820
@@ -830,7 +825,7 @@ static void __init pirq_find_router(struct irq_router *r)
830 return; 825 return;
831 } 826 }
832 827
833 for( h = pirq_routers; h->vendor; h++) { 828 for (h = pirq_routers; h->vendor; h++) {
834 /* First look for a router match */ 829 /* First look for a router match */
835 if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device)) 830 if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device))
836 break; 831 break;
@@ -882,7 +877,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
882 877
883 if (!pirq_table) 878 if (!pirq_table)
884 return 0; 879 return 0;
885 880
886 DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); 881 DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin);
887 info = pirq_get_info(dev); 882 info = pirq_get_info(dev);
888 if (!info) { 883 if (!info) {
@@ -921,8 +916,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
921 */ 916 */
922 newirq = dev->irq; 917 newirq = dev->irq;
923 if (newirq && !((1 << newirq) & mask)) { 918 if (newirq && !((1 << newirq) & mask)) {
924 if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0; 919 if (pci_probe & PCI_USE_PIRQ_MASK)
925 else printk("\n" KERN_WARNING 920 newirq = 0;
921 else
922 printk("\n" KERN_WARNING
926 "PCI: IRQ %i for device %s doesn't match PIRQ mask " 923 "PCI: IRQ %i for device %s doesn't match PIRQ mask "
927 "- try pci=usepirqmask\n" KERN_DEBUG, newirq, 924 "- try pci=usepirqmask\n" KERN_DEBUG, newirq,
928 pci_name(dev)); 925 pci_name(dev));
@@ -942,8 +939,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
942 irq = pirq & 0xf; 939 irq = pirq & 0xf;
943 DBG(" -> hardcoded IRQ %d\n", irq); 940 DBG(" -> hardcoded IRQ %d\n", irq);
944 msg = "Hardcoded"; 941 msg = "Hardcoded";
945 } else if ( r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ 942 } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \
946 ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) { 943 ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) {
947 DBG(" -> got IRQ %d\n", irq); 944 DBG(" -> got IRQ %d\n", irq);
948 msg = "Found"; 945 msg = "Found";
949 eisa_set_level_irq(irq); 946 eisa_set_level_irq(irq);
@@ -978,15 +975,15 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
978 continue; 975 continue;
979 if (info->irq[pin].link == pirq) { 976 if (info->irq[pin].link == pirq) {
980 /* We refuse to override the dev->irq information. Give a warning! */ 977 /* We refuse to override the dev->irq information. Give a warning! */
981 if ( dev2->irq && dev2->irq != irq && \ 978 if (dev2->irq && dev2->irq != irq && \
982 (!(pci_probe & PCI_USE_PIRQ_MASK) || \ 979 (!(pci_probe & PCI_USE_PIRQ_MASK) || \
983 ((1 << dev2->irq) & mask)) ) { 980 ((1 << dev2->irq) & mask))) {
984#ifndef CONFIG_PCI_MSI 981#ifndef CONFIG_PCI_MSI
985 printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", 982 printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n",
986 pci_name(dev2), dev2->irq, irq); 983 pci_name(dev2), dev2->irq, irq);
987#endif 984#endif
988 continue; 985 continue;
989 } 986 }
990 dev2->irq = irq; 987 dev2->irq = irq;
991 pirq_penalty[irq]++; 988 pirq_penalty[irq]++;
992 if (dev != dev2) 989 if (dev != dev2)
@@ -1024,8 +1021,7 @@ static void __init pcibios_fixup_irqs(void)
1024 /* 1021 /*
1025 * Recalculate IRQ numbers if we use the I/O APIC. 1022 * Recalculate IRQ numbers if we use the I/O APIC.
1026 */ 1023 */
1027 if (io_apic_assign_pci_irqs) 1024 if (io_apic_assign_pci_irqs) {
1028 {
1029 int irq; 1025 int irq;
1030 1026
1031 if (pin) { 1027 if (pin) {
@@ -1038,10 +1034,10 @@ static void __init pcibios_fixup_irqs(void)
1038 * busses itself so we should get into this branch reliably. 1034 * busses itself so we should get into this branch reliably.
1039 */ 1035 */
1040 if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ 1036 if (irq < 0 && dev->bus->parent) { /* go back to the bridge */
1041 struct pci_dev * bridge = dev->bus->self; 1037 struct pci_dev *bridge = dev->bus->self;
1042 1038
1043 pin = (pin + PCI_SLOT(dev->devfn)) % 4; 1039 pin = (pin + PCI_SLOT(dev->devfn)) % 4;
1044 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 1040 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
1045 PCI_SLOT(bridge->devfn), pin); 1041 PCI_SLOT(bridge->devfn), pin);
1046 if (irq >= 0) 1042 if (irq >= 0)
1047 printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", 1043 printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n",
@@ -1131,7 +1127,7 @@ static int __init pcibios_irq_init(void)
1131 pirq_find_router(&pirq_router); 1127 pirq_find_router(&pirq_router);
1132 if (pirq_table->exclusive_irqs) { 1128 if (pirq_table->exclusive_irqs) {
1133 int i; 1129 int i;
1134 for (i=0; i<16; i++) 1130 for (i = 0; i < 16; i++)
1135 if (!(pirq_table->exclusive_irqs & (1 << i))) 1131 if (!(pirq_table->exclusive_irqs & (1 << i)))
1136 pirq_penalty[i] += 100; 1132 pirq_penalty[i] += 100;
1137 } 1133 }
@@ -1196,10 +1192,10 @@ static int pirq_enable_irq(struct pci_dev *dev)
1196 */ 1192 */
1197 temp_dev = dev; 1193 temp_dev = dev;
1198 while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ 1194 while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
1199 struct pci_dev * bridge = dev->bus->self; 1195 struct pci_dev *bridge = dev->bus->self;
1200 1196
1201 pin = (pin + PCI_SLOT(dev->devfn)) % 4; 1197 pin = (pin + PCI_SLOT(dev->devfn)) % 4;
1202 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 1198 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
1203 PCI_SLOT(bridge->devfn), pin); 1199 PCI_SLOT(bridge->devfn), pin);
1204 if (irq >= 0) 1200 if (irq >= 0)
1205 printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", 1201 printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n",