Skip to content

Commit

Permalink
irqchip.mips-gic: Fix shared interrupt mask writes
Browse files Browse the repository at this point in the history
The write_gic_smask() & write_gic_rmask() functions take a shared
interrupt number as a parameter, but we're incorrectly providing them a
bitmask with the shared interrupt's bit set. This effectively means that
we mask or unmask the shared interrupt 1<<n rather than shared interrupt
n, and as a result likely drop interrupts.

Signed-off-by: Paul Burton <[email protected]>
Fixes: 68898c8 ("irqchip: mips-gic: Drop gic_(re)set_mask() functions")
Cc: Jason Cooper <[email protected]>
Cc: Marc Zyngier <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Signed-off-by: Marc Zyngier <[email protected]>
  • Loading branch information
paulburton authored and Marc Zyngier committed Sep 19, 2017
1 parent 6c09ffd commit 90019f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/irqchip/irq-mips-gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static void gic_mask_irq(struct irq_data *d)
{
unsigned int intr = GIC_HWIRQ_TO_SHARED(d->hwirq);

write_gic_rmask(BIT(intr));
write_gic_rmask(intr);
gic_clear_pcpu_masks(intr);
}

Expand All @@ -179,7 +179,7 @@ static void gic_unmask_irq(struct irq_data *d)
unsigned int intr = GIC_HWIRQ_TO_SHARED(d->hwirq);
unsigned int cpu;

write_gic_smask(BIT(intr));
write_gic_smask(intr);

gic_clear_pcpu_masks(intr);
cpu = cpumask_first_and(affinity, cpu_online_mask);
Expand Down Expand Up @@ -767,7 +767,7 @@ static int __init gic_of_init(struct device_node *node,
for (i = 0; i < gic_shared_intrs; i++) {
change_gic_pol(i, GIC_POL_ACTIVE_HIGH);
change_gic_trig(i, GIC_TRIG_LEVEL);
write_gic_rmask(BIT(i));
write_gic_rmask(i);
}

for (i = 0; i < gic_vpes; i++) {
Expand Down

0 comments on commit 90019f8

Please sign in to comment.