]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] pci=usepirqmask option.
authorJohn Clemens <john@deater.net>
Tue, 12 Mar 2002 04:53:14 +0000 (20:53 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 12 Mar 2002 04:53:14 +0000 (20:53 -0800)
Last week I sent you a patch adding a config option to honor the pirq mask
in the PCI routing table.  On your suggestion, Cory Bell made it a command
line option using the pci= interface and we both agree with you, it's
-much- cleaner this way.

Patch against 2.5.6 (Cory's submitting for 2.4, I've tested and submitting
towards 2.5).  All credit goes to Cory Bell, with only minor input and
testing from myself.

Documentation/kernel-parameters.txt
arch/i386/kernel/pci-i386.h
arch/i386/kernel/pci-irq.c
arch/i386/kernel/pci-pc.c

index e02079a8dcd5ed3fa266a457775743d6d41e8aa8..b4ed0da89f62fa32c5c2d4e1e6989b2d1ec618e8 100644 (file)
@@ -467,6 +467,14 @@ running once the system is up.
                                        whatever the firmware may have
                                        done.
 
+               usepirqmask             [IA-32] Honor the possible IRQ mask
+                                       stored in the BIOS $PIR table. This is
+                                       needed on some systems with broken
+                                       BIOSes, notably some HP Pavilion N5400
+                                       and Omnibook XE3 notebooks. This will
+                                       have no effect if ACPI IRQ routing is
+                                       enabled.
+
        pd.             [PARIDE]
 
        pf.             [PARIDE]
index 2c821af08fdef14e60aa227ed42669267d1febb8..8f228926d363d66e96a49401167c30aba36f32a7 100644 (file)
@@ -18,6 +18,7 @@
 #define PCI_NO_SORT            0x0100
 #define PCI_BIOS_SORT          0x0200
 #define PCI_NO_CHECKS          0x0400
+#define PCI_USE_PIRQ_MASK      0x0800
 #define PCI_ASSIGN_ROMS                0x1000
 #define PCI_BIOS_IRQ_SCAN      0x2000
 #define PCI_ASSIGN_ALL_BUSSES  0x4000
index 0c45abebda3838796e0a3926eea994cd48f8c39e..10e307f352eaa28cb88d58c6e08cd4f7f339d9e2 100644 (file)
@@ -570,6 +570,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
         * reported by the device if possible.
         */
        newirq = dev->irq;
+       if (!((1 << newirq) & mask)) {
+               if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0;
+               else printk(KERN_WARNING "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n", newirq, dev->slot_name);
+       }
        if (!newirq && assign) {
                for (i = 0; i < 16; i++) {
                        if (!(mask & (1 << i)))
@@ -588,7 +592,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
                irq = pirq & 0xf;
                DBG(" -> hardcoded IRQ %d\n", irq);
                msg = "Hardcoded";
-       } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq))) {
+       } else if ( r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \
+       ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) {
                DBG(" -> got IRQ %d\n", irq);
                msg = "Found";
        } else if (newirq && r->set && (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) {
@@ -622,7 +627,9 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
                        continue;
                if (info->irq[pin].link == pirq) {
                        /* We refuse to override the dev->irq information. Give a warning! */
-                       if (dev2->irq && dev2->irq != irq) {
+                       if ( dev2->irq && dev2->irq != irq && \
+                       (!(pci_probe & PCI_USE_PIRQ_MASK) || \
+                       ((1 << dev2->irq) & mask)) ) {
                                printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n",
                                       dev2->slot_name, dev2->irq, irq);
                                continue;
index 7281c71e046767dc9b0d59317ca39593d65a2602..09dd8808ddd63d394003c793cf35980de298a47f 100644 (file)
@@ -1343,6 +1343,9 @@ char * __devinit  pcibios_setup(char *str)
        } else if (!strcmp(str, "assign-busses")) {
                pci_probe |= PCI_ASSIGN_ALL_BUSSES;
                return NULL;
+       } else if (!strcmp(str, "usepirqmask")) {
+               pci_probe |= PCI_USE_PIRQ_MASK;
+               return NULL;
        } else if (!strncmp(str, "irqmask=", 8)) {
                pcibios_irq_mask = simple_strtol(str+8, NULL, 0);
                return NULL;