diff options
Diffstat (limited to 'arch/x86/pci/irq.c')
-rw-r--r-- | arch/x86/pci/irq.c | 108 |
1 files changed, 50 insertions, 58 deletions
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 6a06a2eb0597..8e077185e185 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -436,7 +436,7 @@ static int pirq_vlsi_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | |||
436 | { | 436 | { |
437 | WARN_ON_ONCE(pirq >= 9); | 437 | WARN_ON_ONCE(pirq >= 9); |
438 | if (pirq > 8) { | 438 | if (pirq > 8) { |
439 | printk(KERN_INFO "VLSI router pirq escape (%d)\n", pirq); | 439 | dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); |
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | return read_config_nybble(router, 0x74, pirq-1); | 442 | return read_config_nybble(router, 0x74, pirq-1); |
@@ -446,7 +446,7 @@ static int pirq_vlsi_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
446 | { | 446 | { |
447 | WARN_ON_ONCE(pirq >= 9); | 447 | WARN_ON_ONCE(pirq >= 9); |
448 | if (pirq > 8) { | 448 | if (pirq > 8) { |
449 | printk(KERN_INFO "VLSI router pirq escape (%d)\n", pirq); | 449 | dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); |
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | write_config_nybble(router, 0x74, pirq-1, irq); | 452 | write_config_nybble(router, 0x74, pirq-1, irq); |
@@ -492,15 +492,17 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
492 | irq = 0; | 492 | irq = 0; |
493 | if (pirq <= 4) | 493 | if (pirq <= 4) |
494 | irq = read_config_nybble(router, 0x56, pirq - 1); | 494 | irq = read_config_nybble(router, 0x56, pirq - 1); |
495 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", | 495 | dev_info(&dev->dev, |
496 | dev->vendor, dev->device, pirq, irq); | 496 | "AMD756: dev [%04x/%04x], router PIRQ %d get IRQ %d\n", |
497 | dev->vendor, dev->device, pirq, irq); | ||
497 | return irq; | 498 | return irq; |
498 | } | 499 | } |
499 | 500 | ||
500 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 501 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
501 | { | 502 | { |
502 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", | 503 | dev_info(&dev->dev, |
503 | dev->vendor, dev->device, pirq, irq); | 504 | "AMD756: dev [%04x/%04x], router PIRQ %d set IRQ %d\n", |
505 | dev->vendor, dev->device, pirq, irq); | ||
504 | if (pirq <= 4) | 506 | if (pirq <= 4) |
505 | write_config_nybble(router, 0x56, pirq - 1, irq); | 507 | write_config_nybble(router, 0x56, pirq - 1, irq); |
506 | return 1; | 508 | return 1; |
@@ -588,6 +590,8 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route | |||
588 | case PCI_DEVICE_ID_INTEL_ICH10_1: | 590 | case PCI_DEVICE_ID_INTEL_ICH10_1: |
589 | case PCI_DEVICE_ID_INTEL_ICH10_2: | 591 | case PCI_DEVICE_ID_INTEL_ICH10_2: |
590 | case PCI_DEVICE_ID_INTEL_ICH10_3: | 592 | case PCI_DEVICE_ID_INTEL_ICH10_3: |
593 | case PCI_DEVICE_ID_INTEL_PCH_0: | ||
594 | case PCI_DEVICE_ID_INTEL_PCH_1: | ||
591 | r->name = "PIIX/ICH"; | 595 | r->name = "PIIX/ICH"; |
592 | r->get = pirq_piix_get; | 596 | r->get = pirq_piix_get; |
593 | r->set = pirq_piix_set; | 597 | r->set = pirq_piix_set; |
@@ -730,7 +734,6 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, | |||
730 | switch (device) { | 734 | switch (device) { |
731 | case PCI_DEVICE_ID_AL_M1533: | 735 | case PCI_DEVICE_ID_AL_M1533: |
732 | case PCI_DEVICE_ID_AL_M1563: | 736 | case PCI_DEVICE_ID_AL_M1563: |
733 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); | ||
734 | r->name = "ALI"; | 737 | r->name = "ALI"; |
735 | r->get = pirq_ali_get; | 738 | r->get = pirq_ali_get; |
736 | r->set = pirq_ali_set; | 739 | r->set = pirq_ali_set; |
@@ -840,11 +843,9 @@ static void __init pirq_find_router(struct irq_router *r) | |||
840 | h->probe(r, pirq_router_dev, pirq_router_dev->device)) | 843 | h->probe(r, pirq_router_dev, pirq_router_dev->device)) |
841 | break; | 844 | break; |
842 | } | 845 | } |
843 | printk(KERN_INFO "PCI: Using IRQ router %s [%04x/%04x] at %s\n", | 846 | dev_info(&pirq_router_dev->dev, "%s IRQ router [%04x/%04x]\n", |
844 | pirq_router.name, | 847 | pirq_router.name, |
845 | pirq_router_dev->vendor, | 848 | pirq_router_dev->vendor, pirq_router_dev->device); |
846 | pirq_router_dev->device, | ||
847 | pci_name(pirq_router_dev)); | ||
848 | 849 | ||
849 | /* The device remains referenced for the kernel lifetime */ | 850 | /* The device remains referenced for the kernel lifetime */ |
850 | } | 851 | } |
@@ -877,7 +878,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
877 | /* Find IRQ pin */ | 878 | /* Find IRQ pin */ |
878 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | 879 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); |
879 | if (!pin) { | 880 | if (!pin) { |
880 | DBG(KERN_DEBUG " -> no interrupt pin\n"); | 881 | dev_dbg(&dev->dev, "no interrupt pin\n"); |
881 | return 0; | 882 | return 0; |
882 | } | 883 | } |
883 | pin = pin - 1; | 884 | pin = pin - 1; |
@@ -887,20 +888,20 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
887 | if (!pirq_table) | 888 | if (!pirq_table) |
888 | return 0; | 889 | return 0; |
889 | 890 | ||
890 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); | ||
891 | info = pirq_get_info(dev); | 891 | info = pirq_get_info(dev); |
892 | if (!info) { | 892 | if (!info) { |
893 | DBG(" -> not found in routing table\n" KERN_DEBUG); | 893 | dev_dbg(&dev->dev, "PCI INT %c not found in routing table\n", |
894 | 'A' + pin); | ||
894 | return 0; | 895 | return 0; |
895 | } | 896 | } |
896 | pirq = info->irq[pin].link; | 897 | pirq = info->irq[pin].link; |
897 | mask = info->irq[pin].bitmap; | 898 | mask = info->irq[pin].bitmap; |
898 | if (!pirq) { | 899 | if (!pirq) { |
899 | DBG(" -> not routed\n" KERN_DEBUG); | 900 | dev_dbg(&dev->dev, "PCI INT %c not routed\n", 'A' + pin); |
900 | return 0; | 901 | return 0; |
901 | } | 902 | } |
902 | DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, | 903 | dev_dbg(&dev->dev, "PCI INT %c -> PIRQ %02x, mask %04x, excl %04x", |
903 | pirq_table->exclusive_irqs); | 904 | 'A' + pin, pirq, mask, pirq_table->exclusive_irqs); |
904 | mask &= pcibios_irq_mask; | 905 | mask &= pcibios_irq_mask; |
905 | 906 | ||
906 | /* Work around broken HP Pavilion Notebooks which assign USB to | 907 | /* Work around broken HP Pavilion Notebooks which assign USB to |
@@ -930,10 +931,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
930 | if (pci_probe & PCI_USE_PIRQ_MASK) | 931 | if (pci_probe & PCI_USE_PIRQ_MASK) |
931 | newirq = 0; | 932 | newirq = 0; |
932 | else | 933 | else |
933 | printk("\n" KERN_WARNING | 934 | dev_warn(&dev->dev, "IRQ %d doesn't match PIRQ mask " |
934 | "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n" | 935 | "%#x; try pci=usepirqmask\n", newirq, mask); |
935 | KERN_DEBUG, newirq, | ||
936 | pci_name(dev)); | ||
937 | } | 936 | } |
938 | if (!newirq && assign) { | 937 | if (!newirq && assign) { |
939 | for (i = 0; i < 16; i++) { | 938 | for (i = 0; i < 16; i++) { |
@@ -944,39 +943,35 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
944 | newirq = i; | 943 | newirq = i; |
945 | } | 944 | } |
946 | } | 945 | } |
947 | DBG(" -> newirq=%d", newirq); | 946 | dev_dbg(&dev->dev, "PCI INT %c -> newirq %d", 'A' + pin, newirq); |
948 | 947 | ||
949 | /* Check if it is hardcoded */ | 948 | /* Check if it is hardcoded */ |
950 | if ((pirq & 0xf0) == 0xf0) { | 949 | if ((pirq & 0xf0) == 0xf0) { |
951 | irq = pirq & 0xf; | 950 | irq = pirq & 0xf; |
952 | DBG(" -> hardcoded IRQ %d\n", irq); | 951 | msg = "hardcoded"; |
953 | msg = "Hardcoded"; | ||
954 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ | 952 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ |
955 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { | 953 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { |
956 | DBG(" -> got IRQ %d\n", irq); | 954 | msg = "found"; |
957 | msg = "Found"; | ||
958 | eisa_set_level_irq(irq); | 955 | eisa_set_level_irq(irq); |
959 | } else if (newirq && r->set && | 956 | } else if (newirq && r->set && |
960 | (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { | 957 | (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { |
961 | DBG(" -> assigning IRQ %d", newirq); | ||
962 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { | 958 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { |
963 | eisa_set_level_irq(newirq); | 959 | eisa_set_level_irq(newirq); |
964 | DBG(" ... OK\n"); | 960 | msg = "assigned"; |
965 | msg = "Assigned"; | ||
966 | irq = newirq; | 961 | irq = newirq; |
967 | } | 962 | } |
968 | } | 963 | } |
969 | 964 | ||
970 | if (!irq) { | 965 | if (!irq) { |
971 | DBG(" ... failed\n"); | ||
972 | if (newirq && mask == (1 << newirq)) { | 966 | if (newirq && mask == (1 << newirq)) { |
973 | msg = "Guessed"; | 967 | msg = "guessed"; |
974 | irq = newirq; | 968 | irq = newirq; |
975 | } else | 969 | } else { |
970 | dev_dbg(&dev->dev, "can't route interrupt\n"); | ||
976 | return 0; | 971 | return 0; |
972 | } | ||
977 | } | 973 | } |
978 | printk(KERN_INFO "PCI: %s IRQ %d for device %s\n", msg, irq, | 974 | dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin, irq); |
979 | pci_name(dev)); | ||
980 | 975 | ||
981 | /* Update IRQ for all devices with the same pirq value */ | 976 | /* Update IRQ for all devices with the same pirq value */ |
982 | while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { | 977 | while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { |
@@ -996,17 +991,17 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
996 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ | 991 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ |
997 | ((1 << dev2->irq) & mask))) { | 992 | ((1 << dev2->irq) & mask))) { |
998 | #ifndef CONFIG_PCI_MSI | 993 | #ifndef CONFIG_PCI_MSI |
999 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", | 994 | dev_info(&dev2->dev, "IRQ routing conflict: " |
1000 | pci_name(dev2), dev2->irq, irq); | 995 | "have IRQ %d, want IRQ %d\n", |
996 | dev2->irq, irq); | ||
1001 | #endif | 997 | #endif |
1002 | continue; | 998 | continue; |
1003 | } | 999 | } |
1004 | dev2->irq = irq; | 1000 | dev2->irq = irq; |
1005 | pirq_penalty[irq]++; | 1001 | pirq_penalty[irq]++; |
1006 | if (dev != dev2) | 1002 | if (dev != dev2) |
1007 | printk(KERN_INFO | 1003 | dev_info(&dev->dev, "sharing IRQ %d with %s\n", |
1008 | "PCI: Sharing IRQ %d with %s\n", | 1004 | irq, pci_name(dev2)); |
1009 | irq, pci_name(dev2)); | ||
1010 | } | 1005 | } |
1011 | } | 1006 | } |
1012 | return 1; | 1007 | return 1; |
@@ -1025,8 +1020,7 @@ static void __init pcibios_fixup_irqs(void) | |||
1025 | * already in use. | 1020 | * already in use. |
1026 | */ | 1021 | */ |
1027 | if (dev->irq >= 16) { | 1022 | if (dev->irq >= 16) { |
1028 | DBG(KERN_DEBUG "%s: ignoring bogus IRQ %d\n", | 1023 | dev_dbg(&dev->dev, "ignoring bogus IRQ %d\n", dev->irq); |
1029 | pci_name(dev), dev->irq); | ||
1030 | dev->irq = 0; | 1024 | dev->irq = 0; |
1031 | } | 1025 | } |
1032 | /* | 1026 | /* |
@@ -1070,12 +1064,12 @@ static void __init pcibios_fixup_irqs(void) | |||
1070 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1064 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1071 | PCI_SLOT(bridge->devfn), pin); | 1065 | PCI_SLOT(bridge->devfn), pin); |
1072 | if (irq >= 0) | 1066 | if (irq >= 0) |
1073 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1067 | dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n", |
1074 | pci_name(bridge), 'A' + pin, irq); | 1068 | pci_name(bridge), |
1069 | 'A' + pin, irq); | ||
1075 | } | 1070 | } |
1076 | if (irq >= 0) { | 1071 | if (irq >= 0) { |
1077 | printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", | 1072 | dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq); |
1078 | pci_name(dev), 'A' + pin, irq); | ||
1079 | dev->irq = irq; | 1073 | dev->irq = irq; |
1080 | } | 1074 | } |
1081 | } | 1075 | } |
@@ -1231,25 +1225,24 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1231 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1225 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1232 | PCI_SLOT(bridge->devfn), pin); | 1226 | PCI_SLOT(bridge->devfn), pin); |
1233 | if (irq >= 0) | 1227 | if (irq >= 0) |
1234 | printk(KERN_WARNING | 1228 | dev_warn(&dev->dev, "using bridge %s " |
1235 | "PCI: using PPB %s[%c] to get irq %d\n", | 1229 | "INT %c to get IRQ %d\n", |
1236 | pci_name(bridge), | 1230 | pci_name(bridge), 'A' + pin, |
1237 | 'A' + pin, irq); | 1231 | irq); |
1238 | dev = bridge; | 1232 | dev = bridge; |
1239 | } | 1233 | } |
1240 | dev = temp_dev; | 1234 | dev = temp_dev; |
1241 | if (irq >= 0) { | 1235 | if (irq >= 0) { |
1242 | printk(KERN_INFO | 1236 | dev_info(&dev->dev, "PCI->APIC IRQ transform: " |
1243 | "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", | 1237 | "INT %c -> IRQ %d\n", 'A' + pin, irq); |
1244 | pci_name(dev), 'A' + pin, irq); | ||
1245 | dev->irq = irq; | 1238 | dev->irq = irq; |
1246 | return 0; | 1239 | return 0; |
1247 | } else | 1240 | } else |
1248 | msg = " Probably buggy MP table."; | 1241 | msg = "; probably buggy MP table"; |
1249 | } else if (pci_probe & PCI_BIOS_IRQ_SCAN) | 1242 | } else if (pci_probe & PCI_BIOS_IRQ_SCAN) |
1250 | msg = ""; | 1243 | msg = ""; |
1251 | else | 1244 | else |
1252 | msg = " Please try using pci=biosirq."; | 1245 | msg = "; please try using pci=biosirq"; |
1253 | 1246 | ||
1254 | /* | 1247 | /* |
1255 | * With IDE legacy devices the IRQ lookup failure is not | 1248 | * With IDE legacy devices the IRQ lookup failure is not |
@@ -1259,9 +1252,8 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1259 | !(dev->class & 0x5)) | 1252 | !(dev->class & 0x5)) |
1260 | return 0; | 1253 | return 0; |
1261 | 1254 | ||
1262 | printk(KERN_WARNING | 1255 | dev_warn(&dev->dev, "can't find IRQ for PCI INT %c%s\n", |
1263 | "PCI: No IRQ known for interrupt pin %c of device %s.%s\n", | 1256 | 'A' + pin, msg); |
1264 | 'A' + pin, pci_name(dev), msg); | ||
1265 | } | 1257 | } |
1266 | return 0; | 1258 | return 0; |
1267 | } | 1259 | } |