Re: 2.5.20 - Xircom PCI Cardbus doesn't work

From: Linus Torvalds (
Date: Sat Jun 15 2002 - 13:48:17 EST

On Fri, 14 Jun 2002, Jeff Garzik wrote:
> Can someone clarify for me the need of pci_request_irq??
> pci_enable_device() assigns the IRQ in routing, but it is not enabled
> until you call request_irq. I don't see any simplification that can be
> done in the PCI API.

The irq _is_ enabled ona hardware level.

Which can be a total disaster if there are shared PCI irq's, and the
interrupt is "screaming" (ie an active level-sensitive thing).

We've had this on cardbus, for example, where we need to do an
"pci_emable_device()" in order to get access to the PCI IO mappings, which
are needed to shut the device up.

Right now the solution to a screaming device can be something as nasty as


        /* IRQ handling needs this ioremapped */
        membase = ioremap(dev->resource[]);

        /* Now we can enable the irq, because we have a valid handler */

which is horribly stupid. We really want to do

        membase = ioremap(dev->resource[]);

        pci_request_irq(dev, irq_handler);

where "pci_request_irq()" enables the interrupt and adds an interrupt
handler atomically.

> The only thing I've wanted is a cross-platform way to detect if
> pdev->irq returned by pci_enable_device is valid.

It's required to be valid, because if it isn't, then the platform is
broken. There are no cross-platform issues: complain to the platform
vendor and/or the linux code for that architecture.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Jun 15 2002 - 22:00:33 EST