Skip to content

Commit e27b163

Browse files
groeckKAGA-KOKO
authored andcommitted
genirq/PM: Always unlock IRQ descriptor in rearm_wake_irq()
rearm_wake_irq() does not unlock the irq descriptor if the interrupt is not suspended or if wakeup is not enabled on it. Restucture the exit conditions so the unlock is always ensured. Fixes: 3a79bc6 ("PCI: irq: Introduce rearm_wake_irq()") Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent fb893de commit e27b163

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

kernel/irq/pm.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,18 @@ void rearm_wake_irq(unsigned int irq)
185185
unsigned long flags;
186186
struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
187187

188-
if (!desc || !(desc->istate & IRQS_SUSPENDED) ||
189-
!irqd_is_wakeup_set(&desc->irq_data))
188+
if (!desc)
190189
return;
191190

191+
if (!(desc->istate & IRQS_SUSPENDED) ||
192+
!irqd_is_wakeup_set(&desc->irq_data))
193+
goto unlock;
194+
192195
desc->istate &= ~IRQS_SUSPENDED;
193196
irqd_set(&desc->irq_data, IRQD_WAKEUP_ARMED);
194197
__enable_irq(desc);
195198

199+
unlock:
196200
irq_put_desc_busunlock(desc, flags);
197201
}
198202

0 commit comments

Comments
 (0)