Skip to content

Commit a045359

Browse files
Charles MirabileKAGA-KOKO
authored andcommitted
irqchip/sifive-plic: Fix call to __plic_toggle() in M-Mode code path
The code path for M-Mode linux that disables interrupts for other contexts was missed when refactoring __plic_toggle(). Since the new version caches updates to the state for the primary context, its use in this codepath is no longer desireable even if it could be made correct. Replace the calls to __plic_toggle() with a loop that simply disables all of the interrupts in groups of 32 with a direct mmio write. Fixes: 14ff9e5 ("irqchip/sifive-plic: Cache the interrupt enable state") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Charles Mirabile <cmirabil@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://patch.msgid.link/20251103161813.2437427-1-cmirabil@redhat.com Closes: https://lore.kernel.org/oe-kbuild-all/202510271316.AQM7gCCy-lkp@intel.com/
1 parent 539d147 commit a045359

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/irqchip/irq-sifive-plic.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,11 @@ static int plic_probe(struct fwnode_handle *fwnode)
679679
if (parent_hwirq != RV_IRQ_EXT) {
680680
/* Disable S-mode enable bits if running in M-mode. */
681681
if (IS_ENABLED(CONFIG_RISCV_M_MODE)) {
682-
void __iomem *enable_base = priv->regs +
683-
CONTEXT_ENABLE_BASE +
684-
i * CONTEXT_ENABLE_SIZE;
682+
u32 __iomem *enable_base = priv->regs + CONTEXT_ENABLE_BASE +
683+
i * CONTEXT_ENABLE_SIZE;
685684

686-
for (hwirq = 1; hwirq <= nr_irqs; hwirq++)
687-
__plic_toggle(enable_base, hwirq, 0);
685+
for (int j = 0; j <= nr_irqs / 32; j++)
686+
writel(0, enable_base + j);
688687
}
689688
continue;
690689
}

0 commit comments

Comments
 (0)