Re: [PATCH 4/5] Centralise NO_IRQ definition
From: Paul Mackerras
Date: Mon Nov 21 2005 - 18:20:16 EST
Linus Torvalds writes:
> On all PC hardware, having a zero in the PCI irq register basically means
> that no irq is enabled. That's a _fact_. It's a fact however much you may
> not like it. It's how the hardware comes up, and it's how the BIOS leaves
> it. So "0" absolutely does mean "not allocated".
First, are you talking about the interrupt pin register or the
interrupt line register?
Secondly, I would say that any driver that looks at either of those
registers is broken. Drivers should be looking at dev->irq, which is
set up by platform code, and may be quite different from what is in
the interrupt line register.
So the question of what PCI devices do with the value in the interrupt
line register is pretty much irrelevant. Those few devices that can
control their interrupt routing (such as cardbus bridges) don't use
the interrupt line register for that AFAIK.
I think all we need is for the convention for drivers to be that they
test for whether the device has an interrupt is to test (dev->irq !=
NO_IRQ). Then x86 can have NO_IRQ = 0 and PPC can have NO_IRQ = -1
and I think everyone is happy (well, nearly everyone, anyway :).
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/