Skip to content

Commit 1a36786

Browse files
committed
genirq/chip: Rework handle_simple_irq()
Use the new helpers to decide whether the interrupt should be handled and switch the descriptor locking to guard(). Fixup the kernel doc comment while at it. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/all/20250429065420.804683349@linutronix.de
1 parent 2ef2e13 commit 1a36786

1 file changed

Lines changed: 10 additions & 20 deletions

File tree

kernel/irq/chip.c

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -538,35 +538,25 @@ void handle_nested_irq(unsigned int irq)
538538
EXPORT_SYMBOL_GPL(handle_nested_irq);
539539

540540
/**
541-
* handle_simple_irq - Simple and software-decoded IRQs.
542-
* @desc: the interrupt description structure for this irq
541+
* handle_simple_irq - Simple and software-decoded IRQs.
542+
* @desc: the interrupt description structure for this irq
543543
*
544-
* Simple interrupts are either sent from a demultiplexing interrupt
545-
* handler or come from hardware, where no interrupt hardware control
546-
* is necessary.
544+
* Simple interrupts are either sent from a demultiplexing interrupt
545+
* handler or come from hardware, where no interrupt hardware control is
546+
* necessary.
547547
*
548-
* Note: The caller is expected to handle the ack, clear, mask and
549-
* unmask issues if necessary.
548+
* Note: The caller is expected to handle the ack, clear, mask and unmask
549+
* issues if necessary.
550550
*/
551551
void handle_simple_irq(struct irq_desc *desc)
552552
{
553-
raw_spin_lock(&desc->lock);
554-
555-
if (!irq_can_handle_pm(desc))
556-
goto out_unlock;
557-
558-
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
553+
guard(raw_spinlock)(&desc->lock);
559554

560-
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
561-
desc->istate |= IRQS_PENDING;
562-
goto out_unlock;
563-
}
555+
if (!irq_can_handle(desc))
556+
return;
564557

565558
kstat_incr_irqs_this_cpu(desc);
566559
handle_irq_event(desc);
567-
568-
out_unlock:
569-
raw_spin_unlock(&desc->lock);
570560
}
571561
EXPORT_SYMBOL_GPL(handle_simple_irq);
572562

0 commit comments

Comments
 (0)