Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: Print CM error reports upon bus errors

If a bus error occurs on a system with a MIPS Coherence Manager (CM)
then the CM may hold useful diagnostic information. Printing this out
has so far been left up to boards, with the requirement that they
register a board_be_handler function & call mips_cm_error_decode() from
there.

In order to avoid boards other than Malta needing to duplicate this
code, call mips_cm_error_decode() automatically if the board registers
no board_be_handler, and remove the Malta implementation of that.

This patch results in no functional change, but removes a further piece
of platform-specific code.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14350/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Burton and committed by
Ralf Baechle
dabdc185 20d33064

+3 -21
+3
arch/mips/kernel/traps.c
··· 49 49 #include <asm/fpu.h> 50 50 #include <asm/fpu_emulator.h> 51 51 #include <asm/idle.h> 52 + #include <asm/mips-cm.h> 52 53 #include <asm/mips-r2-to-r6-emul.h> 53 54 #include <asm/mipsregs.h> 54 55 #include <asm/mipsmtregs.h> ··· 446 445 447 446 if (board_be_handler) 448 447 action = board_be_handler(regs, fixup != NULL); 448 + else 449 + mips_cm_error_report(); 449 450 450 451 switch (action) { 451 452 case MIPS_BE_DISCARD:
-15
arch/mips/mti-malta/malta-int.c
··· 290 290 291 291 setup_irq(corehi_irq, &corehi_irqaction); 292 292 } 293 - 294 - void malta_be_init(void) 295 - { 296 - /* Could change CM error mask register. */ 297 - } 298 - 299 - int malta_be_handler(struct pt_regs *regs, int is_fixup) 300 - { 301 - /* This duplicates the handling in do_be which seems wrong */ 302 - int retval = is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL; 303 - 304 - mips_cm_error_report(); 305 - 306 - return retval; 307 - }
-6
arch/mips/mti-malta/malta-setup.c
··· 42 42 #define ROCIT_CONFIG_GEN0 0x1f403000 43 43 #define ROCIT_CONFIG_GEN0_PCI_IOCU BIT(7) 44 44 45 - extern void malta_be_init(void); 46 - extern int malta_be_handler(struct pt_regs *regs, int is_fixup); 47 - 48 45 static struct resource standard_io_resources[] = { 49 46 { 50 47 .name = "dma1", ··· 298 301 #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 299 302 screen_info_setup(); 300 303 #endif 301 - 302 - board_be_init = malta_be_init; 303 - board_be_handler = malta_be_handler; 304 304 }