riscv: avoid kernel hangs when trapped in BUG()
authorVincent Chen <vincent.chen@sifive.com>
Mon, 23 Sep 2019 00:45:14 +0000 (08:45 +0800)
committerPaul Walmsley <paul.walmsley@sifive.com>
Mon, 7 Oct 2019 19:59:40 +0000 (12:59 -0700)
commit8b04825ed205da38754f86f4c07ea8600d8c2a65
treeb3001866a4a5e2344344e9864ad80a0fa9904da5
parentda0c9ea146cbe92b832f1b0f694840ea8eb33cce
riscv: avoid kernel hangs when trapped in BUG()

When the CONFIG_GENERIC_BUG is disabled by disabling CONFIG_BUG, if a
kernel thread is trapped by BUG(), the whole system will be in the
loop that infinitely handles the ebreak exception instead of entering the
die function. To fix this problem, the do_trap_break() will always call
the die() to deal with the break exception as the type of break is
BUG_TRAP_TYPE_BUG.

Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
arch/riscv/kernel/traps.c