mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Add IRQS_PENDING for nested and simple irq handler as well
@ 2012-05-21 16:48 Ning Jiang
  2012-05-21 21:12 ` Thomas Gleixner
  0 siblings, 1 reply; 9+ messages in thread
From: Ning Jiang @ 2012-05-21 16:48 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: rjw, linux-kernel

>From eb72d4c573b482f85b227558deca297d8a8de1df Mon Sep 17 00:00:00 2001
From: Ning Jiang <ning.n.jiang@gmail.com>
Date: Tue, 22 May 2012 00:19:20 +0800
Subject: [PATCH] genirq: Add IRQS_PENDING for nested and simple irq
handler as well

Usually nested and simple irq act as second level in interrupt
distribution tree, in suspend, we need to keep first level irq
functional by irq flag IRQF_NO_SUSPEND and check the 'pending'
state in the second level.

More information can be found in the log of commit:

commit d4dc0f90d243fb54cfbca6601c9a7c5a758e437f
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Wed Apr 25 12:54:54 2012 +0200

    genirq: Allow check_wakeup_irqs to notice level-triggered interrupts

Signed-off-by: Ning Jiang <ning.n.jiang@gmail.com>
---
 kernel/irq/chip.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 741f836..5bec667 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -275,8 +275,10 @@ void handle_nested_irq(unsigned int irq)
 	kstat_incr_irqs_this_cpu(irq, desc);

 	action = desc->action;
-	if (unlikely(!action || irqd_irq_disabled(&desc->irq_data)))
+	if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) {
+		desc->istate |= IRQS_PENDING;
 		goto out_unlock;
+	}

 	irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
 	raw_spin_unlock_irq(&desc->lock);
@@ -324,8 +326,10 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc)
 	desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
 	kstat_incr_irqs_this_cpu(irq, desc);

-	if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data)))
+	if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
+		desc->istate |= IRQS_PENDING;
 		goto out_unlock;
+	}

 	handle_irq_event(desc);

-- 
1.7.1

Thanks,
Ning

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

end of thread, other threads:[~2012-05-24 20:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21 16:48 Add IRQS_PENDING for nested and simple irq handler as well Ning Jiang
2012-05-21 21:12 ` Thomas Gleixner
2012-05-22  6:00   ` Ning Jiang
2012-05-22  8:49     ` Thomas Gleixner
2012-05-22 11:14       ` Ning Jiang
2012-05-23 16:02         ` Ning Jiang
2012-05-23 19:04           ` Thomas Gleixner
2012-05-24  7:29             ` Ning Jiang
2012-05-24 20:52         ` [tip:irq/core] genirq: Add IRQS_PENDING for nested and simple irq tip-bot for Ning Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome