Skip to content

Commit f71d7c4

Browse files
committed
genirq/chip: Rework handle_fasteoi_mask_irq()
Use the new helpers to decide whether the interrupt should be handled and switch the descriptor locking to guard(). Note: The mask_irq() operation in the second condition was redundant as the interrupt is already masked right at the beginning of the function. 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 2beb01c commit f71d7c4

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

kernel/irq/chip.c

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,51 +1144,31 @@ void handle_fasteoi_ack_irq(struct irq_desc *desc)
11441144
EXPORT_SYMBOL_GPL(handle_fasteoi_ack_irq);
11451145

11461146
/**
1147-
* handle_fasteoi_mask_irq - irq handler for level hierarchy
1148-
* stacked on transparent controllers
1147+
* handle_fasteoi_mask_irq - irq handler for level hierarchy stacked on
1148+
* transparent controllers
11491149
*
1150-
* @desc: the interrupt description structure for this irq
1150+
* @desc: the interrupt description structure for this irq
11511151
*
1152-
* Like handle_fasteoi_irq(), but for use with hierarchy where
1153-
* the irq_chip also needs to have its ->irq_mask_ack() function
1154-
* called.
1152+
* Like handle_fasteoi_irq(), but for use with hierarchy where the irq_chip
1153+
* also needs to have its ->irq_mask_ack() function called.
11551154
*/
11561155
void handle_fasteoi_mask_irq(struct irq_desc *desc)
11571156
{
11581157
struct irq_chip *chip = desc->irq_data.chip;
11591158

1160-
raw_spin_lock(&desc->lock);
1159+
guard(raw_spinlock)(&desc->lock);
11611160
mask_ack_irq(desc);
11621161

1163-
if (!irq_can_handle_pm(desc))
1164-
goto out;
1165-
1166-
desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
1167-
1168-
/*
1169-
* If its disabled or no action available
1170-
* then mask it and get out of here:
1171-
*/
1172-
if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
1173-
desc->istate |= IRQS_PENDING;
1174-
mask_irq(desc);
1175-
goto out;
1162+
if (!irq_can_handle(desc)) {
1163+
cond_eoi_irq(chip, &desc->irq_data);
1164+
return;
11761165
}
11771166

11781167
kstat_incr_irqs_this_cpu(desc);
1179-
if (desc->istate & IRQS_ONESHOT)
1180-
mask_irq(desc);
11811168

11821169
handle_irq_event(desc);
11831170

11841171
cond_unmask_eoi_irq(desc, chip);
1185-
1186-
raw_spin_unlock(&desc->lock);
1187-
return;
1188-
out:
1189-
if (!(chip->flags & IRQCHIP_EOI_IF_HANDLED))
1190-
chip->irq_eoi(&desc->irq_data);
1191-
raw_spin_unlock(&desc->lock);
11921172
}
11931173
EXPORT_SYMBOL_GPL(handle_fasteoi_mask_irq);
11941174

0 commit comments

Comments
 (0)