Re: [PATCH 4/5] Centralise NO_IRQ definition

From: Benjamin Herrenschmidt
Date: Mon Nov 21 2005 - 17:09:29 EST



> 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".

It's not the case on various non-x86 architectures, not the case in the
PCI spec neither.

> Now, the second part of the story is that when it comes to PCI, it doesn't
> matter what Apple, Sun, or pretty much anybody else has done. The reason
> PCI has a separate MMIO and IO space is that it comes from a PC
> background, and the reason Apple and others use PCI is that through that,
> there are thousands of controller cards that are sold for PC's that also
> happen to work on non-PC's.

And ?

> So PC usage really is a defining part of PCI. It's what defines basically
> _all_ of the testing, even under Linux.
>
> So let's face those facts:
> - we have a 8-bit register (0-255) for firmware telling the kernel what
> the pre-allocated interrupt is.

That register is mostly useless on a wide range of architectures tho :)

> - all of those 256 numbers _may_ in fact be valid on some piece of
> hardware.
> - only one of those numbers (0) is de-facto the "no irq line set up"
> value.

No, it's not.

> - pretty much all drivers have been tested mainly with 0 being the "no
> irq" value.
>
> Those are FACTS. Denying them is a sign of stupidity.

I must have lost a lot of neurons in the past few years then.

> I'd suggest that if some architecture can't live with those facts, it
> either:
>
> - define it's own PCI_NO_IRQ value, and face the fact that it will have
> to test the drivers and hope they work (and that a lot of them simply
> will _not_ work).

Very few driver bother at all about the irq value. Most don't test it,
they just use it and be done with it, and that's the way it works. Some
drivers, mostly ISA stuff or legacy stuff or drivers that deal with old
weird chipsets actually look at the irq value, and those can be easily
fixed to use NO_IRQ. I really don't understand why you are making such a
fuss about this...


-
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/