Skip to content

Commit a155777

Browse files
committed
genirq/chip: Rework handle_untracked_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.865212916@linutronix.de
1 parent 1a36786 commit a155777

1 file changed

Lines changed: 16 additions & 27 deletions

File tree

kernel/irq/chip.c

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -561,43 +561,32 @@ void handle_simple_irq(struct irq_desc *desc)
561561
EXPORT_SYMBOL_GPL(handle_simple_irq);
562562

563563
/**
564-
* handle_untracked_irq - Simple and software-decoded IRQs.
565-
* @desc: the interrupt description structure for this irq
564+
* handle_untracked_irq - Simple and software-decoded IRQs.
565+
* @desc: the interrupt description structure for this irq
566566
*
567-
* Untracked interrupts are sent from a demultiplexing interrupt
568-
* handler when the demultiplexer does not know which device it its
569-
* multiplexed irq domain generated the interrupt. IRQ's handled
570-
* through here are not subjected to stats tracking, randomness, or
571-
* spurious interrupt detection.
567+
* Untracked interrupts are sent from a demultiplexing interrupt handler
568+
* when the demultiplexer does not know which device it its multiplexed irq
569+
* domain generated the interrupt. IRQ's handled through here are not
570+
* subjected to stats tracking, randomness, or spurious interrupt
571+
* detection.
572572
*
573-
* Note: Like handle_simple_irq, the caller is expected to handle
574-
* the ack, clear, mask and unmask issues if necessary.
573+
* Note: Like handle_simple_irq, the caller is expected to handle the ack,
574+
* clear, mask and unmask issues if necessary.
575575
*/
576576
void handle_untracked_irq(struct irq_desc *desc)
577577
{
578-
raw_spin_lock(&desc->lock);
579-
580-
if (!irq_can_handle_pm(desc))
581-
goto out_unlock;
582-
583-
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
578+
scoped_guard(raw_spinlock, &desc->lock) {
579+
if (!irq_can_handle(desc))
580+
return;
584581

585-
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
586-
desc->istate |= IRQS_PENDING;
587-
goto out_unlock;
582+
desc->istate &= ~IRQS_PENDING;
583+
irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
588584
}
589585

590-
desc->istate &= ~IRQS_PENDING;
591-
irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
592-
raw_spin_unlock(&desc->lock);
593-
594586
__handle_irq_event_percpu(desc);
595587

596-
raw_spin_lock(&desc->lock);
597-
irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
598-
599-
out_unlock:
600-
raw_spin_unlock(&desc->lock);
588+
scoped_guard(raw_spinlock, &desc->lock)
589+
irqd_clear(&desc->irq_data, IRQD_IRQ_INPROGRESS);
601590
}
602591
EXPORT_SYMBOL_GPL(handle_untracked_irq);
603592

0 commit comments

Comments
 (0)