Skip to content

Commit 740cdfe

Browse files
inochisaRevySR
authored andcommitted
FROMLIST: irqchip/sifive-plic: Respect mask state when setting affinity
The plic_set_affinity always call plic_irq_enable(), which clears up the priority setting even the irq is only masked. This make the irq unmasked unexpectly. Replace the plic_irq_enable/disable() with plic_irq_toggle() to avoid changing priority setting. Suggested-by: Thomas Gleixner <[email protected]> Signed-off-by: Inochi Amaoto <[email protected]> Reviewed-by: Nam Cao <[email protected]> Tested-by: Nam Cao <[email protected]> # VisionFive 2 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Han Gao <[email protected]>
1 parent 1977efe commit 740cdfe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/irqchip/irq-sifive-plic.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,14 @@ static int plic_set_affinity(struct irq_data *d,
179179
if (cpu >= nr_cpu_ids)
180180
return -EINVAL;
181181

182-
plic_irq_disable(d);
182+
/* Invalidate the original routing entry */
183+
plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 0);
183184

184185
irq_data_update_effective_affinity(d, cpumask_of(cpu));
185186

187+
/* Setting the new routing entry if irq is enabled */
186188
if (!irqd_irq_disabled(d))
187-
plic_irq_enable(d);
189+
plic_irq_toggle(irq_data_get_effective_affinity_mask(d), d, 1);
188190

189191
return IRQ_SET_MASK_OK_DONE;
190192
}

0 commit comments

Comments
 (0)