summaryrefslogtreecommitdiffstats
path: root/arch/riscv/kernel/head.S
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-04-15 11:14:36 +0200
committerPalmer Dabbelt <palmer@sifive.com>2019-04-25 23:51:10 +0200
commitdf16c40cbfb43fbd6d5d879585b268b131fa95eb (patch)
treec1c45c1738eddba7c15f06e22bec302a30f47884 /arch/riscv/kernel/head.S
parentriscv: remove CONFIG_RISCV_ISA_A (diff)
downloadlinux-df16c40cbfb43fbd6d5d879585b268b131fa95eb.tar.xz
linux-df16c40cbfb43fbd6d5d879585b268b131fa95eb.zip
riscv: clear all pending interrupts when booting
Just in case an old interrupt is pending make sure we clear everything asserted before this kernel started. Based on similar M-mode code in opensbi. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Nick Kossifidis <mick@ics.forth.gr> Reviewed-by: Atish Patra <atish.patra@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/kernel/head.S')
-rw-r--r--arch/riscv/kernel/head.S3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index fe884cd69abd..9e3840d84d3e 100644
--- a/arch/riscv/kernel/head.S
+++ b/arch/riscv/kernel/head.S
@@ -22,8 +22,9 @@
__INIT
ENTRY(_start)
- /* Mask all interrupts */
+ /* Mask and clear all interrupts */
csrw sie, zero
+ csrw sip, zero
/* Load the global pointer */
.option push