All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration
@ 2012-06-25  3:55 Sundar Iyer
  2012-06-25  5:31 ` Paul Mundt
  0 siblings, 1 reply; 4+ messages in thread
From: Sundar Iyer @ 2012-06-25  3:55 UTC (permalink / raw)
  To: tglx; +Cc: linux-kernel, arjan, lethal, sundar.iyer, german.monroy

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 CHAINED flag being set for such interrupts. fixup_irq()
can then handle such interrupts and not skip them over.

Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
---
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
v3: use a new accessor called IRQ_CHAINED instead of the mask in v2

 arch/x86/kernel/irq.c   |    6 ++++--
 include/linux/irq.h     |    1 +
 include/linux/irqdesc.h |    7 +++++++
 kernel/irq/chip.c       |    1 +
 kernel/irq/settings.h   |    7 +++++++
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 6c0802e..ba7238b 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -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;
 		}
diff --git a/include/linux/irq.h b/include/linux/irq.h
index baa397e..7ec7826 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -87,6 +87,7 @@ enum {
 	IRQ_MOVE_PCNTXT		= (1 << 14),
 	IRQ_NESTED_THREAD	= (1 << 15),
 	IRQ_NOTHREAD		= (1 << 16),
+	IRQ_CHAINED		= (1 << 17),
 };
 
 #define IRQF_MODIFY_MASK	\
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 2d921b3..b170c69 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -120,6 +120,13 @@ static inline int irq_has_action(unsigned int irq)
 	return desc->action != NULL;
 }
 
+/* Test to see if the IRQ is chained */
+static inline int irq_is_chained(unsigned int irq)
+{
+	struct irq_desc *desc = irq_to_desc(irq);
+	return desc->status_use_accessors & IRQ_CHAINED;
+}
+
 /* 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)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 990965e..1c68de0 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -598,6 +598,7 @@ __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
 		irq_settings_set_noprobe(desc);
 		irq_settings_set_norequest(desc);
 		irq_settings_set_nothread(desc);
+		irq_settings_set_chained(desc);
 		irq_startup(desc, true);
 	}
 out:
diff --git a/kernel/irq/settings.h b/kernel/irq/settings.h
index f166783..1814115 100644
--- a/kernel/irq/settings.h
+++ b/kernel/irq/settings.h
@@ -14,6 +14,7 @@ enum {
 	_IRQ_NO_BALANCING	= IRQ_NO_BALANCING,
 	_IRQ_NESTED_THREAD	= IRQ_NESTED_THREAD,
 	_IRQF_MODIFY_MASK	= IRQF_MODIFY_MASK,
+	_IRQ_CHAINED		= IRQ_CHAINED,
 };
 
 #define IRQ_PER_CPU		GOT_YOU_MORON
@@ -26,6 +27,7 @@ enum {
 #define IRQ_NESTED_THREAD	GOT_YOU_MORON
 #undef IRQF_MODIFY_MASK
 #define IRQF_MODIFY_MASK	GOT_YOU_MORON
+#define IRQ_CHAINED		GOT_YOU_MORON
 
 static inline void
 irq_settings_clr_and_set(struct irq_desc *desc, u32 clr, u32 set)
@@ -140,3 +142,8 @@ static inline bool irq_settings_is_nested_thread(struct irq_desc *desc)
 {
 	return desc->status_use_accessors & _IRQ_NESTED_THREAD;
 }
+
+static inline bool irq_settings_set_chained(struct irq_desc *desc)
+{
+	return desc->status_use_accessors |= _IRQ_CHAINED;
+}
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration
  2012-06-25  3:55 [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration Sundar Iyer
@ 2012-06-25  5:31 ` Paul Mundt
  2012-07-02  4:22   ` Iyer, Sundar
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Mundt @ 2012-06-25  5:31 UTC (permalink / raw)
  To: Sundar Iyer; +Cc: tglx, linux-kernel, arjan, german.monroy

On Mon, Jun 25, 2012 at 09:25:07AM +0530, Sundar Iyer wrote:
> 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 CHAINED flag being set for such interrupts. fixup_irq()
> can then handle such interrupts and not skip them over.
> 
> Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
> Reviewed-by: Yang, Fei <fei.yang@intel.com>
> Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>

Looks better to me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration
  2012-06-25  5:31 ` Paul Mundt
@ 2012-07-02  4:22   ` Iyer, Sundar
  2012-07-02  9:02     ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Iyer, Sundar @ 2012-07-02  4:22 UTC (permalink / raw)
  To: tglx, Paul Mundt; +Cc: linux-kernel, arjan, Monroy, German

Hi Thomas/Paul,

Any comments on the latest patch set?

Thanks

>-----Original Message-----
>From: Paul Mundt [mailto:lethal@linux-sh.org]
>Sent: Monday, June 25, 2012 11:02 AM
>To: Iyer, Sundar
>Cc: tglx@linutronix.de; linux-kernel@vger.kernel.org; arjan@linux.intel.com; Monroy,
>German
>Subject: Re: [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration
>
>On Mon, Jun 25, 2012 at 09:25:07AM +0530, Sundar Iyer wrote:
>> 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 CHAINED flag being set for such interrupts. fixup_irq() can
>> then handle such interrupts and not skip them over.
>>
>> Signed-off-by: Sundar Iyer <sundar.iyer@intel.com>
>> Reviewed-by: Yang, Fei <fei.yang@intel.com>
>> Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
>
>Looks better to me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration
  2012-07-02  4:22   ` Iyer, Sundar
@ 2012-07-02  9:02     ` Thomas Gleixner
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gleixner @ 2012-07-02  9:02 UTC (permalink / raw)
  To: Iyer, Sundar; +Cc: Paul Mundt, linux-kernel, arjan, Monroy, German

On Mon, 2 Jul 2012, Iyer, Sundar wrote:

> Hi Thomas/Paul,
> 
> Any comments on the latest patch set?

Yes, it does neither apply on Linus tree nor on tip/irq/core branch.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-02  9:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25  3:55 [PATCH v3 1/1] x86/irq: handle chained interrupts during IRQ migration Sundar Iyer
2012-06-25  5:31 ` Paul Mundt
2012-07-02  4:22   ` Iyer, Sundar
2012-07-02  9:02     ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.