Re: [PATCH] restore libata build on frv





On Tue, 26 Sep 2006, David Woodhouse wrote:

On Tue, 2006-09-26 at 04:52 -0400, Jeff Garzik wrote:
The irq is a special case no matter how we try to prettyify it. We need
two irqs, and PCI only gives us one per device.

That's fine -- but don't use zero to mean none. We have NO_IRQ for that,
and zero isn't an appropriate choice.

Zero _is_ an appropriate choice, dammit!

That NO_IRQ thing should be zero, and any architecture that thinks that
zero is a valid IRQ just needs to fix its own irq mapping so that the
"cookie" doesn't work.

The thing is, it's zero. Get over it. It can't be "-1" or some other
random value like people have indicated, because that thing is often read
from places where "-1" simply isn't a possible value (eg it gets its
default value initialized from a "unsigned char" in MMIO space on x86).

So instead of making everybody and their dog to silly things with some
NO_IRQ define that they haven't historically done, the rule is simple: "0"
means "no irq", so that you can test for it with obvious code like

if (!dev->irq)
..

and then, if your actual _hardware_ things that the bit-pattern with all
bits clear is a valid irq that can be used for normal devices, then what
you do is you add a irq number translation layer (WHICH WE NEED AND HAVE
_ANYWAY_) and make sure that nobody sees that on a _software_ level.

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



Relevant Pages

  • Re: [PATCH 4/5] Centralise NO_IRQ definition
    ... Changing the no-irq value away from zero is going to cause problems in ... is a valid IRQ in lots of places, ... the tree, thus expanding the IRQ space available dynamically. ... However, as far as the current issue goes, I've no concerns for FRV or AM33 ...
    (Linux-Kernel)
  • Re: [PATCH] libata-sff: Dont call bmdma_stop on non DMA capable controllers
    ... If you want to put your bmdma address at zero then libata-sff won't help ... PCI and ATA came from, so anybody who thinks that zero is a valid PCI ... for an IRQ, ... it is set up by architecture-specific code. ...
    (Linux-Kernel)
  • Re: [PATCH 4/5] Centralise NO_IRQ definition
    ... Write an irq value of 0 to the ... Zero means disabled. ... as _defined_ by the C language) won't work. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: [PATCH] libata-sff: Dont call bmdma_stop on non DMA capable controllers
    ... zero" need to map their PCI addresses to something else. ... I believe PCMCIA just uses the generic resource code, ... irq at the hardware level that is zero, then that just means that the irq ...
    (Linux-Kernel)
  • Re: [PATCH] restore libata build on frv
    ... and PCI only gives us one per device. ... That's fine -- but don't use zero to mean none. ... Architectures are supposed to remap any real "irq 0". ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)