diff mbox series

[6/9] riscv: also clear all pending interrupts when booting

Message ID 20190411115623.5749-7-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/9] riscv: use asm-generic/extable.h | expand

Commit Message

Christoph Hellwig April 11, 2019, 11:56 a.m. UTC
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>
---
 arch/riscv/kernel/head.S | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nick Kossifidis April 11, 2019, 3:43 p.m. UTC | #1
Στις 2019-04-11 14:56, Christoph Hellwig έγραψε:
> 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>
> ---
>  arch/riscv/kernel/head.S | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 9344d9ceda24..62d2c9c85433 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

Reviewed-by: Nick Kossifidis <mick@ics.forth.gr>
Atish Patra April 11, 2019, 6:52 p.m. UTC | #2
On 4/11/19 4:57 AM, Christoph Hellwig wrote:
> 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>
> ---
>   arch/riscv/kernel/head.S | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
> index 9344d9ceda24..62d2c9c85433 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
> 

Reviewed-by: Atish Patra <atish.patra@wdc.com>

Regards,
Atish
diff mbox series

Patch

diff --git a/arch/riscv/kernel/head.S b/arch/riscv/kernel/head.S
index 9344d9ceda24..62d2c9c85433 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