diff mbox series

[8/9] riscv: print the unexpected interrupt cause

Message ID 20190411115623.5749-9-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
This has been helpful when debugging my pending nommu port.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 arch/riscv/kernel/irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Nick Kossifidis April 11, 2019, 3:52 p.m. UTC | #1
Στις 2019-04-11 14:56, Christoph Hellwig έγραψε:
> This has been helpful when debugging my pending nommu port.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  arch/riscv/kernel/irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
> index 48e6b7db83a1..b10af8ccd656 100644
> --- a/arch/riscv/kernel/irq.c
> +++ b/arch/riscv/kernel/irq.c
> @@ -54,7 +54,8 @@ asmlinkage void __irq_entry do_IRQ(struct pt_regs 
> *regs)
>  		handle_arch_irq(regs);
>  		break;
>  	default:
> -		panic("unexpected interrupt cause");
> +		pr_alert("unexpected interrupt cause 0x%lx", regs->xcause);
> +		BUG();
>  	}
>  	irq_exit();

Did you mean regs->scause ? There is no xcause field on struct pt_regs 
and
also there is no such register name:
https://github.com/torvalds/linux/blob/master/arch/riscv/include/asm/ptrace.h
Christoph Hellwig April 11, 2019, 3:54 p.m. UTC | #2
On Thu, Apr 11, 2019 at 06:52:06PM +0300, Nick Kossifidis wrote:
>>  	default:
>> -		panic("unexpected interrupt cause");
>> +		pr_alert("unexpected interrupt cause 0x%lx", regs->xcause);
>> +		BUG();
>>  	}
>>  	irq_exit();
>
> Did you mean regs->scause ? There is no xcause field on struct pt_regs and
> also there is no such register name:
> https://github.com/torvalds/linux/blob/master/arch/riscv/include/asm/ptrace.h

Oops.  The field gets renamed in my nommu tree to deal with the fact
that depending on the kernel build it could hold scause or mcause.
I'll respin it without this rename.
Paul Walmsley April 25, 2019, 6:59 p.m. UTC | #3
On Thu, 11 Apr 2019, Christoph Hellwig wrote:

> This has been helpful when debugging my pending nommu port.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Paul Walmsley <paul.walmsley@sifive.com>

> ---
>  arch/riscv/kernel/irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
> index 48e6b7db83a1..b10af8ccd656 100644
> --- a/arch/riscv/kernel/irq.c
> +++ b/arch/riscv/kernel/irq.c
> @@ -54,7 +54,8 @@ asmlinkage void __irq_entry do_IRQ(struct pt_regs *regs)
>  		handle_arch_irq(regs);
>  		break;
>  	default:
> -		panic("unexpected interrupt cause");
> +		pr_alert("unexpected interrupt cause 0x%lx", regs->xcause);
> +		BUG();
>  	}
>  	irq_exit();
>  
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
>
diff mbox series

Patch

diff --git a/arch/riscv/kernel/irq.c b/arch/riscv/kernel/irq.c
index 48e6b7db83a1..b10af8ccd656 100644
--- a/arch/riscv/kernel/irq.c
+++ b/arch/riscv/kernel/irq.c
@@ -54,7 +54,8 @@  asmlinkage void __irq_entry do_IRQ(struct pt_regs *regs)
 		handle_arch_irq(regs);
 		break;
 	default:
-		panic("unexpected interrupt cause");
+		pr_alert("unexpected interrupt cause 0x%lx", regs->xcause);
+		BUG();
 	}
 	irq_exit();