Skip to content

Commit

Permalink
genirq: Define irq_ack() and irq_eoi() helpers
Browse files Browse the repository at this point in the history
The newly-added IRQCHIP_AUTOMASKS_FLOW flag requires some additional
bookkeeping around chip->{irq_ack, irq_eoi}() calls. Define wrappers around
those chip callbacks to drive the IRQD_IRQ_FLOW_MASKED state of an IRQ when
the chip has the IRQCHIP_AUTOMASKS_FLOW flag.

Signed-off-by: Valentin Schneider <valentin.schneider@arm.com>
  • Loading branch information
Valentin Schneider authored and intel-lab-lkp committed May 25, 2021
1 parent 4fabbfe commit 9cb26d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kernel/irq/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,22 @@ void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu)
cpumask_clear_cpu(cpu, desc->percpu_enabled);
}

void ack_irq(struct irq_desc *desc)
{
desc->irq_data.chip->irq_ack(&desc->irq_data);

if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW)
irq_state_set_flow_masked(desc);
}

void eoi_irq(struct irq_desc *desc)
{
desc->irq_data.chip->irq_eoi(&desc->irq_data);

if (desc->irq_data.chip->flags & IRQCHIP_AUTOMASKS_FLOW)
irq_state_clr_flow_masked(desc);
}

static inline void mask_ack_irq(struct irq_desc *desc)
{
if (desc->irq_data.chip->irq_mask_ack) {
Expand Down
2 changes: 2 additions & 0 deletions kernel/irq/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ extern void irq_enable(struct irq_desc *desc);
extern void irq_disable(struct irq_desc *desc);
extern void irq_percpu_enable(struct irq_desc *desc, unsigned int cpu);
extern void irq_percpu_disable(struct irq_desc *desc, unsigned int cpu);
extern void irq_ack(struct irq_desc *desc);
extern void irq_eoi(struct irq_desc *desc);
extern void mask_irq(struct irq_desc *desc);
extern void unmask_irq(struct irq_desc *desc);
extern void unmask_threaded_irq(struct irq_desc *desc);
Expand Down

0 comments on commit 9cb26d4

Please sign in to comment.