Re: PCMCIA IRQ broken by new IRQ router in 2.3.99-pre5

From: Martin Mares (mj@suse.cz)
Date: Mon Apr 17 2000 - 09:24:26 EST


Hi Linus!

> The use of the BIOS interrupt mask is total crap - as the nameimplies it
> is a way for the interrupt routing table to say that certain interrupts
> are _exclusively_ for PCI, but the pre6 code takes it to mean that PCI
> interrupts can only use those irq sources. Which is completely wrong.
>
> Martin, the "exclusive_irq" mask is, as far as I can read the docs, just a
> way of saying which interrups cannot be ISA legacy interrupts (ie which
> interrupts are not hooked up to the interrupt controller at all, and can
> only be accessed through the PIRQ routing). It does not mean that the PIRQ
> routing table could not have entries that are shared with possible ISA
> interrupts.
>
> The only use for that mask is probably something like: if there are
> exclusive PCI interrupts, please
> - don't ever try to use them for legacy interrupt routing (ie the PCMCIA
> 16-bit interrupts, for example)
> - be more eager to give such a PCI-only interrupt to PCI interrupt
> routing (in Linux parlance, this would be equivalent to doing something
> like
>
> /*
> * Penalize PCI-only irq's less, to make them more likely to be
> * chosen for PCI irq routing purposes..
> */
> if (pirq_penalty[irq])
> pirq_penalty[irq]--;
>
> The current code that just does
>
> mask &= pirq_table->exclusive_irqs;
>
> is definitely bad.

You are right. Here is a fix.

                                Have a nice fortnight

-- 
Martin `MJ' Mares <mj@ucw.cz> <mj@suse.cz> http://atrey.karlin.mff.cuni.cz/~mj/
"IBM = Inferior, But Marketable"

--- arch/i386/kernel/pci-irq.c.mj Mon Apr 17 16:07:12 2000 +++ arch/i386/kernel/pci-irq.c Mon Apr 17 16:10:29 2000 @@ -26,14 +26,14 @@ /* * Never use: 0, 1, 2 (timer, keyboard, and cascade) - * Avoid using: 13, 14 and 15 (FP error and IDE). + * Avoid using: 6, 13, 14 and 15 (FDC, FP error and IDE). * Penalize: 3, 4, 7, 12 (known ISA uses: serial, parallel and mouse) */ unsigned int pcibios_irq_mask = ~0; static unsigned pirq_penalty[16] = { - 10000, 10000, 10000, 100, 100, 0, 0, 100, - 0, 0, 0, 0, 100, 1000, 1000, 1000 + 10000, 10000, 10000, 200, 200, 0, 1000, 200, + 0, 0, 0, 0, 200, 1000, 1000, 1000 }; struct irq_router { @@ -299,16 +299,12 @@ return 0; } pirq = info->irq[pin].link; - mask = info->irq[pin].bitmap; + mask = info->irq[pin].bitmap & pcibios_irq_mask; if (!pirq) { DBG(" -> not routed\n"); return 0; } - DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, pirq_table->exclusive_irqs); - if (pcibios_irq_mask != ~0) - mask &= pcibios_irq_mask; - else - mask &= pirq_table->exclusive_irqs; + DBG(" -> PIRQ %02x, mask %04x", pirq, mask); /* Find the best IRQ to assign */ newirq = 0; @@ -369,8 +365,13 @@ pirq_table = pcibios_get_irq_routing_table(); #endif if (pirq_table) { + int i; pirq_peer_trick(); pirq_find_router(); + /* Penalize IRQ's which are not dedicated to PCI */ + for (i=0; i<16; i++) + if (!(pirq_table->exclusive_irqs & (1 << i))) + pirq_penalty[i] += 100; } pci_for_each_dev(dev) {

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:10 EST