* add IRQS_PENDING for nested, simple and level handler to early abort suspend operation
@ 2012-05-18 4:55 Ning Jiang
2012-05-18 7:55 ` Thomas Gleixner
0 siblings, 1 reply; 3+ messages in thread
From: Ning Jiang @ 2012-05-18 4:55 UTC (permalink / raw)
To: tglx, rjw; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 684 bytes --]
During suspend check_wakeup_irqs() will check IRQS_PENDING flag to
abort a suspend operation, however, this only applies for edge
triggered irq. Add IRQS_PENDING for nested, simple and level handler
to mimic the same behaviour as edge irq handler.
Without this optimization, level irq can be handled correctly but there
is some penalty. It has to go through a full run/suspend power cycle for level
irq to be detected and handled. With it, we can abort the suspend operation
earlier and thus shorten the interrupt latency.
I know this is ugly as IRQS_PENDING is intended for edge irq but I don't
know how to do it in a right way. Please enlighten me if you have better ideas.
Ning
[-- Attachment #2: 0001-genirq-add-IRQS_PENDING-for-nested-simple-and-level-.patch --]
[-- Type: application/octet-stream, Size: 1959 bytes --]
From 7b17e5afbe87c6b7892c508df0749d98ff6b02e6 Mon Sep 17 00:00:00 2001
From: Ning Jiang <ning.n.jiang@gmail.com>
Date: Fri, 18 May 2012 11:12:32 +0800
Subject: [PATCH] genirq: add IRQS_PENDING for nested, simple and level handler
During suspend check_wakeup_irqs() will check IRQS_PENDING flag to
abort a suspend operation, however, this only applies for edge
triggered irq. Add IRQS_PENDING for nested, simple and level handler
to mimic the same behaviour as edge irq handler.
Signed-off-by: Ning Jiang <ning.n.jiang@gmail.com>
---
kernel/irq/chip.c | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 3914c1e..eebd6d5 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);
@@ -379,8 +383,10 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
* If its disabled or no action available
* keep it masked and get out of here
*/
- 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: add IRQS_PENDING for nested, simple and level handler to early abort suspend operation
2012-05-18 4:55 add IRQS_PENDING for nested, simple and level handler to early abort suspend operation Ning Jiang
@ 2012-05-18 7:55 ` Thomas Gleixner
2012-05-18 9:45 ` Ning Jiang
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Gleixner @ 2012-05-18 7:55 UTC (permalink / raw)
To: Ning Jiang; +Cc: rjw, linux-kernel
On Fri, 18 May 2012, Ning Jiang wrote:
> During suspend check_wakeup_irqs() will check IRQS_PENDING flag to
> abort a suspend operation, however, this only applies for edge
> triggered irq. Add IRQS_PENDING for nested, simple and level handler
> to mimic the same behaviour as edge irq handler.
>
> Without this optimization, level irq can be handled correctly but there
> is some penalty. It has to go through a full run/suspend power cycle for level
> irq to be detected and handled. With it, we can abort the suspend operation
> earlier and thus shorten the interrupt latency.
>
> I know this is ugly as IRQS_PENDING is intended for edge irq but I don't
> know how to do it in a right way. Please enlighten me if you have better ideas.
First of all, please send patches inlined. Aside of that a similar
patch is queued in tip/irq/core commit d4dc0f90.
Thanks,
tglx
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: add IRQS_PENDING for nested, simple and level handler to early abort suspend operation
2012-05-18 7:55 ` Thomas Gleixner
@ 2012-05-18 9:45 ` Ning Jiang
0 siblings, 0 replies; 3+ messages in thread
From: Ning Jiang @ 2012-05-18 9:45 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: rjw, linux-kernel
Sorry that I didn't notice the patch in tip/irq/core. It did exactly
what I want. Forget about my patch. One more question: Do we need to
change handle_simple_irq and handle_nested_irq too?
Thanks,
Ning
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-18 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18 4:55 add IRQS_PENDING for nested, simple and level handler to early abort suspend operation Ning Jiang
2012-05-18 7:55 ` Thomas Gleixner
2012-05-18 9:45 ` 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