Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c214c035 authored by Tony Wu's avatar Tony Wu Committed by Ralf Baechle
Browse files

MIPS: GIC: Fix gic_set_affinity infinite loop



There is an infinite loop in gic_set_affinity. When irq_set_affinity
gets called on gic controller, it blocks forever.

Signed-off-by: default avatarTony Wu <tung7970@gmail.com>
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/5537/


Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 8dfdd02a
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -219,7 +219,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,

	/* Assumption : cpumask refers to a single CPU */
	spin_lock_irqsave(&gic_lock, flags);
	for (;;) {

	/* Re-route this IRQ */
	GIC_SH_MAP_TO_VPE_SMASK(irq, first_cpu(tmp));

@@ -228,7 +228,6 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask,
		clear_bit(irq, pcpu_masks[i].pcpu_mask);
	set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);

	}
	cpumask_copy(d->affinity, cpumask);
	spin_unlock_irqrestore(&gic_lock, flags);