Skip to content

Commit c609045

Browse files
committed
genirq: Split up irq_pm_check_wakeup()
Let the calling code check for the IRQD_WAKEUP_ARMED flag to prepare for a live lock mitigation in the edge type handler. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Liangyan <liangyan.peng@bytedance.com> Link: https://lore.kernel.org/all/20250718185312.012392426@linutronix.de
1 parent 4e879de commit c609045

3 files changed

Lines changed: 11 additions & 13 deletions

File tree

kernel/irq/chip.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,10 @@ static bool irq_can_handle_pm(struct irq_desc *desc)
488488
* and suspended, disable it and notify the pm core about the
489489
* event.
490490
*/
491-
if (irq_pm_check_wakeup(desc))
491+
if (unlikely(irqd_has_set(irqd, IRQD_WAKEUP_ARMED))) {
492+
irq_pm_handle_wakeup(desc);
492493
return false;
494+
}
493495

494496
/* Check whether the interrupt is polled on another CPU */
495497
if (unlikely(desc->istate & IRQS_POLL_INPROGRESS)) {

kernel/irq/internals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@ static inline bool irq_is_nmi(struct irq_desc *desc)
277277
}
278278

279279
#ifdef CONFIG_PM_SLEEP
280-
bool irq_pm_check_wakeup(struct irq_desc *desc);
280+
void irq_pm_handle_wakeup(struct irq_desc *desc);
281281
void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action);
282282
void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action);
283283
#else
284-
static inline bool irq_pm_check_wakeup(struct irq_desc *desc) { return false; }
284+
static inline void irq_pm_handle_wakeup(struct irq_desc *desc) { }
285285
static inline void
286286
irq_pm_install_action(struct irq_desc *desc, struct irqaction *action) { }
287287
static inline void

kernel/irq/pm.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@
1313

1414
#include "internals.h"
1515

16-
bool irq_pm_check_wakeup(struct irq_desc *desc)
16+
void irq_pm_handle_wakeup(struct irq_desc *desc)
1717
{
18-
if (irqd_is_wakeup_armed(&desc->irq_data)) {
19-
irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED);
20-
desc->istate |= IRQS_SUSPENDED | IRQS_PENDING;
21-
desc->depth++;
22-
irq_disable(desc);
23-
pm_system_irq_wakeup(irq_desc_get_irq(desc));
24-
return true;
25-
}
26-
return false;
18+
irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED);
19+
desc->istate |= IRQS_SUSPENDED | IRQS_PENDING;
20+
desc->depth++;
21+
irq_disable(desc);
22+
pm_system_irq_wakeup(irq_desc_get_irq(desc));
2723
}
2824

2925
/*

0 commit comments

Comments
 (0)