]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
genirq: Split up irq_pm_check_wakeup()
authorThomas Gleixner <tglx@linutronix.de>
Fri, 18 Jul 2025 18:54:10 +0000 (20:54 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 22 Jul 2025 12:30:42 +0000 (14:30 +0200)
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
kernel/irq/chip.c
kernel/irq/internals.h
kernel/irq/pm.c

index 290244ca28dd4b2abb0943bd94dc87322e8cf31b..11ecf6c78c014de388aa8e5829fa10b2acbe2046 100644 (file)
@@ -488,8 +488,10 @@ static bool irq_can_handle_pm(struct irq_desc *desc)
         * and suspended, disable it and notify the pm core about the
         * event.
         */
-       if (irq_pm_check_wakeup(desc))
+       if (unlikely(irqd_has_set(irqd, IRQD_WAKEUP_ARMED))) {
+               irq_pm_handle_wakeup(desc);
                return false;
+       }
 
        /* Check whether the interrupt is polled on another CPU */
        if (unlikely(desc->istate & IRQS_POLL_INPROGRESS)) {
index 82b0d67022c4610524e2ea5aa5d2b3dba8684efd..0164ca48da59e04f98757c46587e2d4e1c537853 100644 (file)
@@ -277,11 +277,11 @@ static inline bool irq_is_nmi(struct irq_desc *desc)
 }
 
 #ifdef CONFIG_PM_SLEEP
-bool irq_pm_check_wakeup(struct irq_desc *desc);
+void irq_pm_handle_wakeup(struct irq_desc *desc);
 void irq_pm_install_action(struct irq_desc *desc, struct irqaction *action);
 void irq_pm_remove_action(struct irq_desc *desc, struct irqaction *action);
 #else
-static inline bool irq_pm_check_wakeup(struct irq_desc *desc) { return false; }
+static inline void irq_pm_handle_wakeup(struct irq_desc *desc) { }
 static inline void
 irq_pm_install_action(struct irq_desc *desc, struct irqaction *action) { }
 static inline void
index 445912d51033e81d3a2e69ecacf33d8c06b6fd50..f7394729cedc3de9ff0673eff374a165e2ac3655 100644 (file)
 
 #include "internals.h"
 
-bool irq_pm_check_wakeup(struct irq_desc *desc)
+void irq_pm_handle_wakeup(struct irq_desc *desc)
 {
-       if (irqd_is_wakeup_armed(&desc->irq_data)) {
-               irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED);
-               desc->istate |= IRQS_SUSPENDED | IRQS_PENDING;
-               desc->depth++;
-               irq_disable(desc);
-               pm_system_irq_wakeup(irq_desc_get_irq(desc));
-               return true;
-       }
-       return false;
+       irqd_clear(&desc->irq_data, IRQD_WAKEUP_ARMED);
+       desc->istate |= IRQS_SUSPENDED | IRQS_PENDING;
+       desc->depth++;
+       irq_disable(desc);
+       pm_system_irq_wakeup(irq_desc_get_irq(desc));
 }
 
 /*