[PATCH] [7/9] pasemi: Configure DMA controller interrupts

Olof Johansson olof at lixom.net
Mon Feb 5 15:52:58 EST 2007


On Mon, Feb 05, 2007 at 10:53:49AM +1100, Benjamin Herrenschmidt wrote:
> On Thu, 2007-02-01 at 22:54 -0600, Olof Johansson wrote:
> > plain text document attachment (pasemi-dma-irqs)
> > The DMA controller on PWRficient is somewhat special -- has a PCI header
> > so it looks like it's on the root PCI (-Express) root bus, but it uses
> > more than the default number of interrupts (and they are hardwired).
> > 
> > We need to wire up all interrupts for the DMA controller. The generic
> > IRQ code will only map the primary interrupt from the PCI header (128),
> > so add 129->211 by hand.
> 
> Or you can have them in the device-tree ... the generic code only maps
> PCI IRQ index 0 but nothing prevents your fixup code to map the other
> ones.

I don't see the point in having them in the device tree fixups instead
of pci fixups. I'll move them to the driver for now.

> However, I do wonder what is the point of creating a mapping and nor
> storing the resulting virq anywhere ?

Current usage was relying on the virqs being allocated linearly with
the rest. Yes, that's in hindsight broken.

> When are those IRQs actually used ?

In the ethernet driver;

       ret = request_irq(mac->dma_pdev->irq + mac->dma_txch,
                         &pasemi_mac_tx_intr, IRQF_DISABLED,
                         mac->tx->irq_name, dev);
[...]

       ret = request_irq(mac->dma_pdev->irq + 20 + mac->dma_rxch,
                         &pasemi_mac_rx_intr, IRQF_DISABLED,
                         mac->rx->irq_name, dev);

> That is the place where the mapping should happen... There is no
> guarantee that the resulting virq from irq_create_mapping() will be the
> same as the HW irq you passed in (it will in -most- cases with the
> current code, but it's a bug to rely on that behaviour). Thus you should
> store the result of irq_create_mapping() and use that. I see no
> advantage in "pre-mapping" things that way.

I'll submit an incremental patch to the ethernet driver.


-Olof



More information about the Linuxppc-dev mailing list