Lines Matching +full:irq +full:- +full:device
1 // SPDX-License-Identifier: GPL-2.0
3 * Low-Level PCI Support for PC -- Routing of Interrupts
5 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
17 #include <linux/irq.h>
46 u16 vendor, device; member
54 int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device);
61 * Check passed address for the PCI IRQ Routing Table signature
72 if (rt->signature != PIRQ_SIGNATURE || in pirq_check_routing_table()
73 rt->version != PIRQ_VERSION || in pirq_check_routing_table()
74 rt->size % 16 || in pirq_check_routing_table()
75 rt->size < sizeof(struct irq_routing_table)) in pirq_check_routing_table()
78 for (i = 0; i < rt->size; i++) in pirq_check_routing_table()
91 * Search 0xf0000 -- 0xfffff for the PCI IRQ Routing Table.
114 * If we have a IRQ routing table, use it to search for peer host
127 for (i = 0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { in pirq_peer_trick()
128 e = &rt->slots[i]; in pirq_peer_trick()
132 DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); in pirq_peer_trick()
134 DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); in pirq_peer_trick()
138 busmap[e->bus] = 1; in pirq_peer_trick()
145 pcibios_last_bus = -1; in pirq_peer_trick()
149 * Code for querying and setting of IRQ routes on various interrupt routers.
153 void elcr_set_level_irq(unsigned int irq) in elcr_set_level_irq() argument
155 unsigned char mask = 1 << (irq & 7); in elcr_set_level_irq()
156 unsigned int port = 0x4d0 + (irq >> 3); in elcr_set_level_irq()
160 if (irq >= 16 || (1 << irq) & elcr_irq_mask) in elcr_set_level_irq()
163 elcr_irq_mask |= (1 << irq); in elcr_set_level_irq()
164 printk(KERN_DEBUG "PCI: setting IRQ %u as level-triggered\n", irq); in elcr_set_level_irq()
167 DBG(KERN_DEBUG " -> edge"); in elcr_set_level_irq()
173 * Common IRQ routing practice: nibbles in config space,
206 return irqmap[read_config_nybble(router, 0x48, pirq-1)]; in pirq_ali_get()
209 static int pirq_ali_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_ali_set() argument
212 unsigned int val = irqmap[irq]; in pirq_ali_set()
216 write_config_nybble(router, 0x48, pirq-1, val); in pirq_ali_set()
234 static int pirq_piix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_piix_set() argument
236 pci_write_config_byte(router, pirq, irq); in pirq_piix_set()
241 * The VIA pirq rules are nibble-based, like ALI,
242 * but without the ugly irq number munging.
250 static int pirq_via_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_via_set() argument
252 write_config_nybble(router, 0x55, pirq == 4 ? 5 : pirq, irq); in pirq_via_set()
257 * The VIA pirq rules are nibble-based, like ALI,
258 * but without the ugly irq number munging.
266 return read_config_nybble(router, 0x55, pirqmap[pirq-1]); in pirq_via586_get()
269 static int pirq_via586_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_via586_set() argument
274 write_config_nybble(router, 0x55, pirqmap[pirq-1], irq); in pirq_via586_set()
279 * ITE 8330G pirq rules are nibble-based
281 * 2+3 are both mapped to irq 9 on my system
288 return read_config_nybble(router, 0x43, pirqmap[pirq-1]); in pirq_ite_get()
291 static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_ite_set() argument
296 write_config_nybble(router, 0x43, pirqmap[pirq-1], irq); in pirq_ite_set()
309 static int pirq_opti_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_opti_set() argument
311 write_config_nybble(router, 0xb8, pirq >> 4, irq); in pirq_opti_set()
322 return read_config_nybble(router, 0x5C, (pirq-1)^1); in pirq_cyrix_get()
325 static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_cyrix_set() argument
327 write_config_nybble(router, 0x5C, (pirq-1)^1, irq); in pirq_cyrix_set()
334 * - vendors have different ideas about the meaning of link values
335 * - some onboard devices (integrated in the chipset) have special
336 * links and are thus routed differently (i.e. not via PCI INTA-INTD)
337 * - different revision of the router have a different layout for
342 * bit 7 IRQ mapping enabled (0) or disabled (1)
344 * bits [3:0] IRQ to map to
345 * allowed: 3-7, 9-12, 14-15
348 * The config-space registers located at 0x41/0x42/0x43/0x44 are
351 * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D.
354 * Currently (2003-05-21) it appears most SiS chipsets follow the
355 * definition of routing registers from the SiS-5595 southbridge.
357 * router (ISA-bridge) should be 0x01 or 0xb0.
362 * some concern because of the two USB-OHCI HCs (original SiS 5595
365 * Onchip routing for router rev-id 0x01/0xb0 and probably 0x00/0xb1:
369 * bit 4 channel-select primary (0), secondary (1)
374 * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved
376 * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved
378 * We support USBIRQ (in addition to INTA-INTD) and keep the
386 * Onchip routing for router rev-id 0x04 (try-and-error observation)
388 * 0x60/0x61/0x62/0x63: 1xEHCI and 3xOHCI (companion) USB-HCs
389 * bit 6-4 are probably unused, not like 5595
408 static int pirq_sis_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_sis_set() argument
418 x |= irq ? irq: PIRQ_SIS_IRQ_DISABLE; in pirq_sis_set()
425 * VLSI: nibble offset 0x74 - educated guess due to routing table and
426 * config space of VLSI 82C534 PCI-bridge/router (1004:0102)
428 * devices, PIRQ 3 for non-pci(!) soundchip and (untested) PIRQ 6
436 dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); in pirq_vlsi_get()
439 return read_config_nybble(router, 0x74, pirq-1); in pirq_vlsi_get()
442 static int pirq_vlsi_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_vlsi_set() argument
446 dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); in pirq_vlsi_set()
449 write_config_nybble(router, 0x74, pirq-1, irq); in pirq_vlsi_set()
454 * ServerWorks: PCI interrupts mapped to system IRQ lines through Index
457 * register is a straight binary coding of desired PIC IRQ (low nibble).
471 int pirq, int irq) in pirq_serverworks_set() argument
474 outb(irq, 0xc01); in pirq_serverworks_set()
478 /* Support for AMD756 PCI IRQ Routing
482 * The AMD756 pirq rules are nibble-based
483 * offset 0x56 0-3 PIRQA 4-7 PIRQB
484 * offset 0x57 0-3 PIRQC 4-7 PIRQD
488 u8 irq; in pirq_amd756_get() local
489 irq = 0; in pirq_amd756_get()
491 irq = read_config_nybble(router, 0x56, pirq - 1); in pirq_amd756_get()
492 dev_info(&dev->dev, in pirq_amd756_get()
493 "AMD756: dev [%04x:%04x], router PIRQ %d get IRQ %d\n", in pirq_amd756_get()
494 dev->vendor, dev->device, pirq, irq); in pirq_amd756_get()
495 return irq; in pirq_amd756_get()
498 static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_amd756_set() argument
500 dev_info(&dev->dev, in pirq_amd756_set()
501 "AMD756: dev [%04x:%04x], router PIRQ %d set IRQ %d\n", in pirq_amd756_set()
502 dev->vendor, dev->device, pirq, irq); in pirq_amd756_set()
504 write_config_nybble(router, 0x56, pirq - 1, irq); in pirq_amd756_set()
513 outb(0x10 + ((pirq - 1) >> 1), 0x24); in pirq_pico_get()
514 return ((pirq - 1) & 1) ? (inb(0x26) >> 4) : (inb(0x26) & 0xf); in pirq_pico_get()
518 int irq) in pirq_pico_set() argument
521 outb(0x10 + ((pirq - 1) >> 1), 0x24); in pirq_pico_set()
523 x = ((pirq - 1) & 1) ? ((x & 0x0f) | (irq << 4)) : ((x & 0xf0) | (irq)); in pirq_pico_set()
530 static int pirq_bios_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) in pirq_bios_set() argument
534 return pcibios_set_irq_routing(bridge, pin - 1, irq); in pirq_bios_set()
539 static __init int intel_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in intel_router_probe() argument
547 /* 440GX has a proprietary PIRQ router -- don't use it */ in intel_router_probe()
551 switch (device) { in intel_router_probe()
593 r->name = "PIIX/ICH"; in intel_router_probe()
594 r->get = pirq_piix_get; in intel_router_probe()
595 r->set = pirq_piix_set; in intel_router_probe()
599 if ((device >= PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN && in intel_router_probe()
600 device <= PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX) in intel_router_probe()
601 || (device >= PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MIN && in intel_router_probe()
602 device <= PCI_DEVICE_ID_INTEL_COUGARPOINT_LPC_MAX) in intel_router_probe()
603 || (device >= PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MIN && in intel_router_probe()
604 device <= PCI_DEVICE_ID_INTEL_DH89XXCC_LPC_MAX) in intel_router_probe()
605 || (device >= PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MIN && in intel_router_probe()
606 device <= PCI_DEVICE_ID_INTEL_PANTHERPOINT_LPC_MAX)) { in intel_router_probe()
607 r->name = "PIIX/ICH"; in intel_router_probe()
608 r->get = pirq_piix_get; in intel_router_probe()
609 r->set = pirq_piix_set; in intel_router_probe()
617 struct pci_dev *router, u16 device) in via_router_probe() argument
624 if (device == PCI_DEVICE_ID_VIA_82C586_0) { in via_router_probe()
625 switch (router->device) { in via_router_probe()
629 * as 586-compatible in via_router_probe()
631 device = PCI_DEVICE_ID_VIA_82C686; in via_router_probe()
635 * Asus a7v-x bios wrongly reports 8235 in via_router_probe()
636 * as 586-compatible in via_router_probe()
638 device = PCI_DEVICE_ID_VIA_8235; in via_router_probe()
643 * as 586-compatible in via_router_probe()
645 device = PCI_DEVICE_ID_VIA_8237; in via_router_probe()
650 switch (device) { in via_router_probe()
652 r->name = "VIA"; in via_router_probe()
653 r->get = pirq_via586_get; in via_router_probe()
654 r->set = pirq_via586_set; in via_router_probe()
663 r->name = "VIA"; in via_router_probe()
664 r->get = pirq_via_get; in via_router_probe()
665 r->set = pirq_via_set; in via_router_probe()
671 static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in vlsi_router_probe() argument
673 switch (device) { in vlsi_router_probe()
675 r->name = "VLSI 82C534"; in vlsi_router_probe()
676 r->get = pirq_vlsi_get; in vlsi_router_probe()
677 r->set = pirq_vlsi_set; in vlsi_router_probe()
685 struct pci_dev *router, u16 device) in serverworks_router_probe() argument
687 switch (device) { in serverworks_router_probe()
690 r->name = "ServerWorks"; in serverworks_router_probe()
691 r->get = pirq_serverworks_get; in serverworks_router_probe()
692 r->set = pirq_serverworks_set; in serverworks_router_probe()
698 static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in sis_router_probe() argument
700 if (device != PCI_DEVICE_ID_SI_503) in sis_router_probe()
703 r->name = "SIS"; in sis_router_probe()
704 r->get = pirq_sis_get; in sis_router_probe()
705 r->set = pirq_sis_set; in sis_router_probe()
709 static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in cyrix_router_probe() argument
711 switch (device) { in cyrix_router_probe()
713 r->name = "NatSemi"; in cyrix_router_probe()
714 r->get = pirq_cyrix_get; in cyrix_router_probe()
715 r->set = pirq_cyrix_set; in cyrix_router_probe()
721 static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in opti_router_probe() argument
723 switch (device) { in opti_router_probe()
725 r->name = "OPTI"; in opti_router_probe()
726 r->get = pirq_opti_get; in opti_router_probe()
727 r->set = pirq_opti_set; in opti_router_probe()
733 static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in ite_router_probe() argument
735 switch (device) { in ite_router_probe()
737 r->name = "ITE"; in ite_router_probe()
738 r->get = pirq_ite_get; in ite_router_probe()
739 r->set = pirq_ite_set; in ite_router_probe()
745 static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in ali_router_probe() argument
747 switch (device) { in ali_router_probe()
750 r->name = "ALI"; in ali_router_probe()
751 r->get = pirq_ali_get; in ali_router_probe()
752 r->set = pirq_ali_set; in ali_router_probe()
758 static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in amd_router_probe() argument
760 switch (device) { in amd_router_probe()
762 r->name = "AMD756"; in amd_router_probe()
765 r->name = "AMD766"; in amd_router_probe()
768 r->name = "AMD768"; in amd_router_probe()
773 r->get = pirq_amd756_get; in amd_router_probe()
774 r->set = pirq_amd756_set; in amd_router_probe()
778 static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) in pico_router_probe() argument
780 switch (device) { in pico_router_probe()
782 r->name = "PicoPower PT86C523"; in pico_router_probe()
783 r->get = pirq_pico_get; in pico_router_probe()
784 r->set = pirq_pico_set; in pico_router_probe()
788 r->name = "PicoPower PT86C523 rev. BB+"; in pico_router_probe()
789 r->get = pirq_pico_get; in pico_router_probe()
790 r->set = pirq_pico_set; in pico_router_probe()
826 if (!rt->signature) { in pirq_find_router()
827 printk(KERN_INFO "PCI: Using BIOS for IRQ routing\n"); in pirq_find_router()
828 r->set = pirq_bios_set; in pirq_find_router()
829 r->name = "BIOS"; in pirq_find_router()
835 r->name = "default"; in pirq_find_router()
836 r->get = NULL; in pirq_find_router()
837 r->set = NULL; in pirq_find_router()
839 DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n", in pirq_find_router()
840 rt->rtr_vendor, rt->rtr_device); in pirq_find_router()
842 pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus, in pirq_find_router()
843 rt->rtr_devfn); in pirq_find_router()
846 "%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn); in pirq_find_router()
850 for (h = pirq_routers; h->vendor; h++) { in pirq_find_router()
852 if (rt->rtr_vendor == h->vendor && in pirq_find_router()
853 h->probe(r, pirq_router_dev, rt->rtr_device)) in pirq_find_router()
855 /* Fall back to a device match */ in pirq_find_router()
856 if (pirq_router_dev->vendor == h->vendor && in pirq_find_router()
857 h->probe(r, pirq_router_dev, pirq_router_dev->device)) in pirq_find_router()
860 dev_info(&pirq_router_dev->dev, "%s IRQ router [%04x:%04x]\n", in pirq_find_router()
862 pirq_router_dev->vendor, pirq_router_dev->device); in pirq_find_router()
864 /* The device remains referenced for the kernel lifetime */ in pirq_find_router()
870 int entries = (rt->size - sizeof(struct irq_routing_table)) / in pirq_get_info()
874 for (info = rt->slots; entries--; info++) in pirq_get_info()
875 if (info->bus == dev->bus->number && in pirq_get_info()
876 PCI_SLOT(info->devfn) == PCI_SLOT(dev->devfn)) in pirq_get_info()
886 int irq = 0; in pcibios_lookup_irq() local
892 /* Find IRQ pin */ in pcibios_lookup_irq()
895 dev_dbg(&dev->dev, "no interrupt pin\n"); in pcibios_lookup_irq()
902 /* Find IRQ routing entry */ in pcibios_lookup_irq()
909 dev_dbg(&dev->dev, "PCI INT %c not found in routing table\n", in pcibios_lookup_irq()
910 'A' + pin - 1); in pcibios_lookup_irq()
913 pirq = info->irq[pin - 1].link; in pcibios_lookup_irq()
914 mask = info->irq[pin - 1].bitmap; in pcibios_lookup_irq()
916 dev_dbg(&dev->dev, "PCI INT %c not routed\n", 'A' + pin - 1); in pcibios_lookup_irq()
919 dev_dbg(&dev->dev, "PCI INT %c -> PIRQ %02x, mask %04x, excl %04x", in pcibios_lookup_irq()
920 'A' + pin - 1, pirq, mask, pirq_table->exclusive_irqs); in pcibios_lookup_irq()
924 IRQ 9 even though it is actually wired to IRQ 11 */ in pcibios_lookup_irq()
926 if (broken_hp_bios_irq9 && pirq == 0x59 && dev->irq == 9) { in pcibios_lookup_irq()
927 dev->irq = 11; in pcibios_lookup_irq()
929 r->set(pirq_router_dev, dev, pirq, 11); in pcibios_lookup_irq()
932 /* same for Acer Travelmate 360, but with CB and irq 11 -> 10 */ in pcibios_lookup_irq()
933 if (acer_tm360_irqrouting && dev->irq == 11 && in pcibios_lookup_irq()
934 dev->vendor == PCI_VENDOR_ID_O2) { in pcibios_lookup_irq()
937 dev->irq = r->get(pirq_router_dev, dev, pirq); in pcibios_lookup_irq()
938 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); in pcibios_lookup_irq()
942 * Find the best IRQ to assign: use the one in pcibios_lookup_irq()
943 * reported by the device if possible. in pcibios_lookup_irq()
945 newirq = dev->irq; in pcibios_lookup_irq()
950 dev_warn(&dev->dev, "IRQ %d doesn't match PIRQ mask " in pcibios_lookup_irq()
962 dev_dbg(&dev->dev, "PCI INT %c -> newirq %d", 'A' + pin - 1, newirq); in pcibios_lookup_irq()
966 irq = pirq & 0xf; in pcibios_lookup_irq()
968 } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ in pcibios_lookup_irq()
969 ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { in pcibios_lookup_irq()
971 elcr_set_level_irq(irq); in pcibios_lookup_irq()
972 } else if (newirq && r->set && in pcibios_lookup_irq()
973 (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { in pcibios_lookup_irq()
974 if (r->set(pirq_router_dev, dev, pirq, newirq)) { in pcibios_lookup_irq()
977 irq = newirq; in pcibios_lookup_irq()
981 if (!irq) { in pcibios_lookup_irq()
984 irq = newirq; in pcibios_lookup_irq()
986 dev_dbg(&dev->dev, "can't route interrupt\n"); in pcibios_lookup_irq()
990 dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin - 1, irq); in pcibios_lookup_irq()
992 /* Update IRQ for all devices with the same pirq value */ in pcibios_lookup_irq()
1001 if (info->irq[pin - 1].link == pirq) { in pcibios_lookup_irq()
1003 * We refuse to override the dev->irq in pcibios_lookup_irq()
1006 if (dev2->irq && dev2->irq != irq && \ in pcibios_lookup_irq()
1008 ((1 << dev2->irq) & mask))) { in pcibios_lookup_irq()
1010 dev_info(&dev2->dev, "IRQ routing conflict: " in pcibios_lookup_irq()
1011 "have IRQ %d, want IRQ %d\n", in pcibios_lookup_irq()
1012 dev2->irq, irq); in pcibios_lookup_irq()
1016 dev2->irq = irq; in pcibios_lookup_irq()
1017 pirq_penalty[irq]++; in pcibios_lookup_irq()
1019 dev_info(&dev->dev, "sharing IRQ %d with %s\n", in pcibios_lookup_irq()
1020 irq, pci_name(dev2)); in pcibios_lookup_irq()
1031 DBG(KERN_DEBUG "PCI: IRQ fixup\n"); in pcibios_fixup_irqs()
1034 * If the BIOS has set an out of range IRQ number, just in pcibios_fixup_irqs()
1035 * ignore it. Also keep track of which IRQ's are in pcibios_fixup_irqs()
1038 if (dev->irq >= 16) { in pcibios_fixup_irqs()
1039 dev_dbg(&dev->dev, "ignoring bogus IRQ %d\n", dev->irq); in pcibios_fixup_irqs()
1040 dev->irq = 0; in pcibios_fixup_irqs()
1043 * If the IRQ is already assigned to a PCI device, in pcibios_fixup_irqs()
1046 if (pirq_penalty[dev->irq] >= 100 && in pcibios_fixup_irqs()
1047 pirq_penalty[dev->irq] < 100000) in pcibios_fixup_irqs()
1048 pirq_penalty[dev->irq] = 0; in pcibios_fixup_irqs()
1049 pirq_penalty[dev->irq]++; in pcibios_fixup_irqs()
1062 * Still no IRQ? Try to lookup one... in pcibios_fixup_irqs()
1064 if (!dev->irq) in pcibios_fixup_irqs()
1071 * IRQ 9 even though it is actually wired to IRQ 11
1077 printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", in fix_broken_hp_bios_irq9()
1078 d->ident); in fix_broken_hp_bios_irq9()
1085 * Cardbus to IRQ 11 even though it is actually wired to IRQ 10
1091 printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", in fix_acer_tm360_irqrouting()
1092 d->ident); in fix_acer_tm360_irqrouting()
1102 DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
1106 DMI_MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736"),
1124 DBG(KERN_DEBUG "PCI: IRQ init\n"); in pcibios_irq_init()
1142 if (pirq_table->exclusive_irqs) { in pcibios_irq_init()
1145 if (!(pirq_table->exclusive_irqs & (1 << i))) in pcibios_irq_init()
1149 * If we're using the I/O APIC, avoid using the PCI IRQ in pcibios_irq_init()
1163 * PCI IRQ routing is set up by pci_enable_device(), but we in pcibios_irq_init()
1173 static void pirq_penalize_isa_irq(int irq, int active) in pirq_penalize_isa_irq() argument
1176 * If any ISAPnP device reports an IRQ in its list of possible in pirq_penalize_isa_irq()
1177 * IRQ's, we try to avoid assigning it to PCI devices. in pirq_penalize_isa_irq()
1179 if (irq < 16) { in pirq_penalize_isa_irq()
1181 pirq_penalty[irq] += 1000; in pirq_penalize_isa_irq()
1183 pirq_penalty[irq] += 100; in pirq_penalize_isa_irq()
1187 void pcibios_penalize_isa_irq(int irq, int active) in pcibios_penalize_isa_irq() argument
1191 acpi_penalize_isa_irq(irq, active); in pcibios_penalize_isa_irq()
1194 pirq_penalize_isa_irq(irq, active); in pcibios_penalize_isa_irq()
1205 if (!io_apic_assign_pci_irqs && dev->irq) in pirq_enable_irq()
1211 int irq; in pirq_enable_irq() local
1213 if (dev->irq_managed && dev->irq > 0) in pirq_enable_irq()
1216 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, in pirq_enable_irq()
1217 PCI_SLOT(dev->devfn), pin - 1); in pirq_enable_irq()
1219 * Busses behind bridges are typically not listed in the MP-table. in pirq_enable_irq()
1220 * In this case we have to look up the IRQ based on the parent bus, in pirq_enable_irq()
1225 while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ in pirq_enable_irq()
1226 struct pci_dev *bridge = dev->bus->self; in pirq_enable_irq()
1229 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, in pirq_enable_irq()
1230 PCI_SLOT(bridge->devfn), in pirq_enable_irq()
1231 pin - 1); in pirq_enable_irq()
1232 if (irq >= 0) in pirq_enable_irq()
1233 dev_warn(&dev->dev, "using bridge %s " in pirq_enable_irq()
1234 "INT %c to get IRQ %d\n", in pirq_enable_irq()
1235 pci_name(bridge), 'A' + pin - 1, in pirq_enable_irq()
1236 irq); in pirq_enable_irq()
1240 if (irq >= 0) { in pirq_enable_irq()
1241 dev->irq_managed = 1; in pirq_enable_irq()
1242 dev->irq = irq; in pirq_enable_irq()
1243 dev_info(&dev->dev, "PCI->APIC IRQ transform: " in pirq_enable_irq()
1244 "INT %c -> IRQ %d\n", 'A' + pin - 1, irq); in pirq_enable_irq()
1255 * With IDE legacy devices the IRQ lookup failure is not in pirq_enable_irq()
1258 if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE && in pirq_enable_irq()
1259 !(dev->class & 0x5)) in pirq_enable_irq()
1262 dev_warn(&dev->dev, "can't find IRQ for PCI INT %c%s\n", in pirq_enable_irq()
1263 'A' + pin - 1, msg); in pirq_enable_irq()
1268 bool mp_should_keep_irq(struct device *dev) in mp_should_keep_irq()
1270 if (dev->power.is_prepared) in mp_should_keep_irq()
1273 if (dev->power.runtime_status == RPM_SUSPENDING) in mp_should_keep_irq()
1282 if (io_apic_assign_pci_irqs && !mp_should_keep_irq(&dev->dev) && in pirq_disable_irq()
1283 dev->irq_managed && dev->irq) { in pirq_disable_irq()
1284 mp_unmap_irq(dev->irq); in pirq_disable_irq()
1285 dev->irq = 0; in pirq_disable_irq()
1286 dev->irq_managed = 0; in pirq_disable_irq()