sparc: Provide NO_IRQ definition.
David Miller
maintainerPATCH 1/1 sparc: Provide NO_IRQ definition.
--- arch/sparc/include/asm/irq_32.h | 3 +++ arch/sparc/include/asm/irq_64.h | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-)
arch/sparc/include/asm/irq_32.h +3 -0
@@ -13,4 +13,7 @@#define irq_canonicalize (irq) (irq)extern void __init init_IRQ (void ); + +#define NO_IRQ 0xffffffff +#endif
arch/sparc/include/asm/irq_64.h +2 -0
@@ -97,4 +97,6 @@ extern void *softirq_stack[NR_CPUS];#define __ARCH_HAS_DO_SOFTIRQ#define ARCH_HAS_NMI_WATCHDOG +#define NO_IRQ 0xffffffff +#endif
Signature · 1 line
1.7.4.1
Quoted 24 lines · David Miller
Signed-off-by David S. Miller <[email protected]>--- arch/sparc/include/asm/irq_32.h | 3 +++ arch/sparc/include/asm/irq_64.h | 2 ++ 2 files changed, 5 insertions(+), 0 deletions(-)arch/sparc/include/asm/irq_32.h +3
-0@@ -13,4 +13,7 @@#define irq_canonicalize (irq) (irq)extern void __init init_IRQ (void ); + +#define NO_IRQ 0xffffffff +#endif arch/sparc/include/asm/irq_64.h +0
-0
arch/sparc/include/asm/irq_64.h extern void *softirq_stack[NR_CPUS]; · line 102
Quoted 6 lines
arch/sparc/include/asm/irq_64.h +2
-0@@ -97,4 +97,6 @@ extern void *softirq_stack[NR_CPUS];#define __ARCH_HAS_DO_SOFTIRQ#define ARCH_HAS_NMI_WATCHDOG +#define NO_IRQ 0xffffffff +#endif
Why -1 (0xffffffff)?
drivers/of/irq.c default to 0 - like this:
/* For archs that don't support NO_IRQ (such as x86), provide a dummy value */ #ifndef NO_IRQ
#define NO_IRQ 0
#endif
I can see that the actual value differs from arch to arch.
I recalled a discussion about this topic some years ago. Do not ask how I managed to do so?!?
Anyway the input from Linus was to use 0 for NO_IRQ because as he said:
==
But the point is that most drivers will do something like
if (!dev->irq) return;
(whatever, made up). And that having NO_IRQ be anything but 0 is thus fundamentally broken.
==
See the full mail here:
http://lkml.org/lkml/2005/11/21/211
I do not know of any places that would break - I just wanted to bring this to your attention.
Sam
David Miller
maintainerFrom: Sam Ravnborg <[email protected]>
Date: Fri, 18 Mar 2011 23:48:10 +0100
Quoted 1 line
Why -1 (
0xffffffff)?
Because that is what the OF device object creation layer treats as no-IRQ.
See for example the test in of_device_64.c:build_one_device_irq() where we go:
if (irq = 0xffffffff) return irq;
Quoted 5 lines · David Miller
From: Sam Ravnborg <[email protected]>
Date: Fri, 18 Mar 2011 23:48:10 +0100Quoted 1 line
Why -1 (
0xffffffff)?
Quoted 8 lines
Because that is what the OF device object creation layer treats as no-IRQ.
See for example the test in of_device_64.c:build_one_device_irq() where we go:
if (irq = 0xffffffff) return irq;
Understood - thanks.
Sam