Skip to content

Commit 2beb01c

Browse files
committed
genirq/chip: Rework handle_fasteoi_ack_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 <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 2d46aea commit 2beb01c

File tree

1 file changed

+13
-26
lines changed

1 file changed

+13
-26
lines changed

kernel/irq/chip.c

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,53 +1106,40 @@ void irq_cpu_offline(void)
11061106

11071107
#ifdef CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS
11081108
/**
1109-
* handle_fasteoi_ack_irq - irq handler for edge hierarchy
1110-
* stacked on transparent controllers
1109+
* handle_fasteoi_ack_irq - irq handler for edge hierarchy stacked on
1110+
* transparent controllers
11111111
*
1112-
* @desc: the interrupt description structure for this irq
1112+
* @desc: the interrupt description structure for this irq
11131113
*
1114-
* Like handle_fasteoi_irq(), but for use with hierarchy where
1115-
* the irq_chip also needs to have its ->irq_ack() function
1116-
* called.
1114+
* Like handle_fasteoi_irq(), but for use with hierarchy where the irq_chip
1115+
* also needs to have its ->irq_ack() function called.
11171116
*/
11181117
void handle_fasteoi_ack_irq(struct irq_desc *desc)
11191118
{
11201119
struct irq_chip *chip = desc->irq_data.chip;
11211120

1122-
raw_spin_lock(&desc->lock);
1123-
1124-
if (!irq_can_handle_pm(desc))
1125-
goto out;
1121+
guard(raw_spinlock)(&desc->lock);
11261122

1127-
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
1123+
if (!irq_can_handle_pm(desc)) {
1124+
cond_eoi_irq(chip, &desc->irq_data);
1125+
return;
1126+
}
11281127

1129-
/*
1130-
* If its disabled or no action available
1131-
* then mask it and get out of here:
1132-
*/
1133-
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
1134-
desc->istate |= IRQS_PENDING;
1128+
if (unlikely(!irq_can_handle_actions(desc))) {
11351129
mask_irq(desc);
1136-
goto out;
1130+
cond_eoi_irq(chip, &desc->irq_data);
1131+
return;
11371132
}
11381133

11391134
kstat_incr_irqs_this_cpu(desc);
11401135
if (desc->istate & IRQS_ONESHOT)
11411136
mask_irq(desc);
11421137

1143-
/* Start handling the irq */
11441138
desc->irq_data.chip->irq_ack(&desc->irq_data);
11451139

11461140
handle_irq_event(desc);
11471141

11481142
cond_unmask_eoi_irq(desc, chip);
1149-
1150-
raw_spin_unlock(&desc->lock);
1151-
return;
1152-
out:
1153-
if (!(chip->flags & IRQCHIP_EOI_IF_HANDLED))
1154-
chip->irq_eoi(&desc->irq_data);
1155-
raw_spin_unlock(&desc->lock);
11561143
}
11571144
EXPORT_SYMBOL_GPL(handle_fasteoi_ack_irq);
11581145

0 commit comments

Comments
 (0)