Skip to content

Commit dabdc18

Browse files
paulburtonralfbaechle
authored andcommitted
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>
1 parent 20d3306 commit dabdc18

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

arch/mips/kernel/traps.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <asm/fpu.h>
5050
#include <asm/fpu_emulator.h>
5151
#include <asm/idle.h>
52+
#include <asm/mips-cm.h>
5253
#include <asm/mips-r2-to-r6-emul.h>
5354
#include <asm/mipsregs.h>
5455
#include <asm/mipsmtregs.h>
@@ -445,6 +446,8 @@ asmlinkage void do_be(struct pt_regs *regs)
445446

446447
if (board_be_handler)
447448
action = board_be_handler(regs, fixup != NULL);
449+
else
450+
mips_cm_error_report();
448451

449452
switch (action) {
450453
case MIPS_BE_DISCARD:

arch/mips/mti-malta/malta-int.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,3 @@ void __init arch_init_irq(void)
290290

291291
setup_irq(corehi_irq, &corehi_irqaction);
292292
}
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-
}

arch/mips/mti-malta/malta-setup.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
#define ROCIT_CONFIG_GEN0 0x1f403000
4343
#define ROCIT_CONFIG_GEN0_PCI_IOCU BIT(7)
4444

45-
extern void malta_be_init(void);
46-
extern int malta_be_handler(struct pt_regs *regs, int is_fixup);
47-
4845
static struct resource standard_io_resources[] = {
4946
{
5047
.name = "dma1",
@@ -301,7 +298,4 @@ void __init plat_mem_setup(void)
301298
#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
302299
screen_info_setup();
303300
#endif
304-
305-
board_be_init = malta_be_init;
306-
board_be_handler = malta_be_handler;
307301
}

0 commit comments

Comments
 (0)