]> git.baikalelectronics.ru Git - kernel.git/commit
RISC-V: Don't enable all interrupts in trap_init()
authorAnup Patel <anup.patel@wdc.com>
Sun, 2 Feb 2020 11:02:02 +0000 (16:32 +0530)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Tue, 18 Feb 2020 18:34:04 +0000 (10:34 -0800)
commitb5706740cc9a59ad597290ae1a35c77c2c9ddb1b
treeb3276a7e054211e946d56879c7245412ebfca492
parent572f6802316760ea20ab2c56da1a996daccfb480
RISC-V: Don't enable all interrupts in trap_init()

Historically, we have been enabling all interrupts for each
HART in trap_init(). Ideally, we should only enable M-mode
interrupts for M-mode kernel and S-mode interrupts for S-mode
kernel in trap_init().

Currently, we get suprious S-mode interrupts on Kendryte K210
board running M-mode NO-MMU kernel because we are enabling all
interrupts in trap_init(). To fix this, we only enable software
and external interrupt in trap_init(). In future, trap_init()
will only enable software interrupt and PLIC driver will enable
external interrupt using CPU notifiers.

Fixes: def77bfd3387 ("riscv: abstract out CSR names for supervisor vs machine mode")
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Tested-by: Palmer Dabbelt <palmerdabbelt@google.com> [QMEU virt machine with SMP]
[Palmer: Move the Fixes up to a newer commit]
Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/kernel/traps.c