Skip to contentSkip to conversation

x86/irq: handle chained interrupts during IRQ migration

PATCH Superseded Sundar Iyer 2 participants 3 messages May 30, 2012 – Jun 6, 2012 x86

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/irq: handle chained interrupts during IRQ migration

Chained interrupt handlers dont have an irqaction and hence are not handled during migrating interrupts when some cores go offline.

Handle this by introducing a irq_is_chained() check which is based on the the very least NOREQUEST, NOPROBE, and NOTHREAD flags being set for such interrupts. fixup_irq() can then handle such interrupts and not skip them over.

Change-Id I011de8bee98c1702a362deb06106845ca7bcad61

---
v1: use accessors instead of new variables to identify chained irqs
v2: use a mask of NOREQUEST, NOPROBE, and NOTHREAD accessor flags as per Paul M

 arch/x86/kernel/irq.c   |    6 ++++--
 include/linux/irqdesc.h |   11 +++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
arch/x86/kernel/irq.c +4 -2
index 6c0802e..acd7949 100644
@@ -249,8 +249,10 @@ void fixup_irqs(void)
 
 		data = irq_desc_get_irq_data(desc);
 		affinity = data->affinity;
-		if (!irq_has_action(irq) || irqd_is_per_cpu(data) ||
-		    cpumask_subset(affinity, cpu_online_mask)) {
+		/* include IRQs who have no action, but are chained */
+		if ((!irq_has_action(irq) && irq_is_chained(irq)) ||
+			irqd_is_per_cpu(data) ||
+			cpumask_subset(affinity, cpu_online_mask)) {
 			raw_spin_unlock(&desc->lock);
 			continue;
 		}
include/linux/irqdesc.h +11 -0
index 2d921b3..8d5eb42 100644
@@ -120,6 +120,17 @@ static inline int irq_has_action(unsigned int irq)
 	return desc->action != NULL;
 }
 
+/*
+ * Test to see if the IRQ is chained; it would not be requested and hence
+ * very miinimum _IRQ_NOREQUEST, _IRQ_NOPROBE, _IRQ_NOTHREAD  would be set
+ */
+static inline int irq_is_chained(unsigned int irq)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+	return !(desc->status_use_accessors &
+			(IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOTHREAD));
+}
+
 /* caller has locked the irq_desc and both params are valid */
 static inline void __irq_set_handler_locked(unsigned int irq,
 					    irq_flow_handler_t handler)
Signature · 1 line
1.7.1
#1 lore raw

Hi Thomas,

Any comments on this version? Or do you suggest to add a new flag in the accessors and set it?

Thanks

Quoted 64 lines

-----Original Message-----
From: Iyer, Sundar
Sent: Wednesday, May 30, 2012 2:59 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Iyer, Sundar; Monroy, German
Subject: [PATCH v2] x86/irq: handle chained interrupts during IRQ migration

Chained interrupt handlers dont have an irqaction and hence are not handled during migrating interrupts when some cores go offline.

Handle this by introducing a irq_is_chained() check which is based on the the very least NOREQUEST, NOPROBE, and NOTHREAD flags being set for such interrupts. fixup_irq() can then handle such interrupts and not skip them over.

Change-Id I011de8bee98c1702a362deb06106845ca7bcad61

---
v1: use accessors instead of new variables to identify chained irqs
v2: use a mask of NOREQUEST, NOPROBE, and NOTHREAD accessor flags as per Paul M

arch/x86/kernel/irq.c | 6 ++++--
include/linux/irqdesc.h | 11 +++++++++++

2 files changed, 15 insertions(+), 2 deletions(-)
arch/x86/kernel/irq.c +4 -2
@@ -249,8 +249,10 @@ void fixup_irqs(void)
 
 		data = irq_desc_get_irq_data(desc);
 		affinity = data->affinity;
-		if (!irq_has_action(irq) || irqd_is_per_cpu(data) ||
-		    cpumask_subset(affinity, cpu_online_mask)) {
+		/* include IRQs who have no action, but are chained */
+		if ((!irq_has_action(irq) && irq_is_chained(irq)) ||
+			irqd_is_per_cpu(data) ||
+			cpumask_subset(affinity, cpu_online_mask)) {
 			raw_spin_unlock(&desc->lock);
 			continue;
 		}
include/linux/irqdesc.h index 2d921b3..8d5eb42 renamed from include/linux/irqdesc.h +0 -0

100644

include/linux/irqdesc.h +9 -1
@@ -120,6 +120,17 @@ static inline int irq_has_action(unsigned int irq)
 	return desc->action != NULL;
 }
 
+/*
+ * Test to see if the IRQ is chained; it would not be requested and
+hence
+ * very miinimum _IRQ_NOREQUEST, _IRQ_NOPROBE, _IRQ_NOTHREAD  would be
+set  */ static inline int irq_is_chained(unsigned int irq) {
+	struct irq_desc *desc = irq_to_desc(irq);
+	return !(desc->status_use_accessors &
+			(IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOTHREAD)); }
+
 /* caller has locked the irq_desc and both params are valid */  static inline void
 __irq_set_handler_locked(unsigned int irq,
 					    irq_flow_handler_t handler)
--

1.7.1

#2 lore raw
Quoted 3 lines · Sundar

Any comments on this version? Or do you suggest to add a new flag in the accessors and set it?

That's what I said IIRC.