Skip to contentSkip to conversation

sparc: Provide NO_IRQ definition.

PATCH In review David Miller 2 participants 4 messages Mar 18, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 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
index cbf4801..eced3e3 100644
@@ -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
index 4f09666f..16dcae6d 100644
@@ -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
#1 lore raw
Quoted 24 lines · David Miller
---
 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
index cbf4801..eced3e3 100644
@@ -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
index 4f09666f..16dcae6d 100644

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

author maintainer
#2 lore raw
In reply to David Miller

From: 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;
#3 lore raw
In reply to David Miller
Quoted 5 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Fri, 18 Mar 2011 23:48:10 +0100

Quoted 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