Skip to content

Commit

Permalink
drivers: soc: andes: Fix an error for print_detailed_cause() on impre…
Browse files Browse the repository at this point in the history
…cise exception (torvalds#101)

To print error messages for imprecise exception, extract the field sdcause
in the CSR sdcause instead of reading the whole register.

Signed-off-by: Ben Zong-You Xie <[email protected]>

Reviewed-on: https://gitea.andestech.com/RD-SW/linux/pulls/101
Reviewed-by: Tim Shih-Ting OuYang <[email protected]>
Reviewed-by: Leo Yu-Chi Liang <[email protected]>
Reviewed-by: Dylan Dai-Rong Jhong <[email protected]>
Co-authored-by: Ben Zong-You Xie <[email protected]>
Co-committed-by: Ben Zong-You Xie <[email protected]>
  • Loading branch information
Ben Zong-You Xie authored and Dylan-Jhong committed Dec 26, 2023
1 parent 83dcb7a commit aaadbe5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/soc/andes/dcause.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void print_detailed_cause(long scause, unsigned long sdcause)
}
} else {
scause &= ~CAUSE_IRQ_FLAG;
sdcause &= SDCAUSE_DCAUSE_MASK;
switch (scause) {
case IRQ_IMPRECISE_ECC:
pr_info("The detailed trap cause: %s\n",
Expand Down
2 changes: 2 additions & 0 deletions include/soc/andes/dcause.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#define IRQ_BUS_RW_TRANS 0x111
#define IRQ_PMOVI 0x112

#define SDCAUSE_DCAUSE_MASK 0x1f

static const char *const sdcause_fetch_access[] = {
"Reserved",
"ECC/Parity error",
Expand Down

0 comments on commit aaadbe5

Please sign in to comment.