Skip to content

Commit 23812b9

Browse files
ningjiangKAGA-KOKO
authored andcommitted
genirq: Add IRQS_PENDING for nested and simple irq
Every interrupt which is an active wakeup source needs the ability to abort suspend if there is a pending irq. Right now only edge and level irqs can do that. | +---------+ | INTC | +---------+ | GPIO_IRQ +------------+ | gpio-exp | +------------+ | | GPIO0_IRQ GPIO1_IRQ In the above diagram, gpio expander has irq number GPIO_IRQ, it is connected with two sub GPIO pins, GPIO0 and GPIO1. During suspend, we set IRQF_NO_SUSPEND for GPIO_IRQ so that gpio expander driver can handle the sub irq GPIO0_IRQ and GPIO1_IRQ, and these two irqs themselves can further be handled by simple or nested irq in some drivers(typically gpio and mfd driver). If they are used as wakeup sources during suspend, we want them to be able to abort suspend too. Setting IRQS_PENDING flag in handle_nested_irq() and handle_simple_irq() when the irq is disabled allows check_wakeup_irqs() to identify such irqs as source for aborting suspend. Signed-off-by: Ning Jiang <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/CAH3Oq6T905%[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
1 parent f936991 commit 23812b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kernel/irq/chip.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,10 @@ void handle_nested_irq(unsigned int irq)
275275
kstat_incr_irqs_this_cpu(irq, desc);
276276

277277
action = desc->action;
278-
if (unlikely(!action || irqd_irq_disabled(&desc->irq_data)))
278+
if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) {
279+
desc->istate |= IRQS_PENDING;
279280
goto out_unlock;
281+
}
280282

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

327-
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data)))
329+
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
330+
desc->istate |= IRQS_PENDING;
328331
goto out_unlock;
332+
}
329333

330334
handle_irq_event(desc);
331335

0 commit comments

Comments
 (0)