From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933196AbcH3Rcv (ORCPT ); Tue, 30 Aug 2016 13:32:51 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:37948 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932789AbcH3Rcp (ORCPT ); Tue, 30 Aug 2016 13:32:45 -0400 From: Paul Burton To: , Ralf Baechle CC: Paul Burton , Matt Redfearn , "Maciej W. Rozycki" , Masahiro Yamada , Paolo Bonzini , Kees Cook , , James Hogan , Andrew Morton , Markos Chandras Subject: [PATCH v2 10/26] MIPS: Print CM error reports upon bus errors Date: Tue, 30 Aug 2016 18:29:13 +0100 Message-ID: <20160830172929.16948-11-paul.burton@imgtec.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160830172929.16948-1-paul.burton@imgtec.com> References: <20160830172929.16948-1-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.100.200.118] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v2: None arch/mips/kernel/traps.c | 3 +++ arch/mips/mti-malta/malta-int.c | 15 --------------- arch/mips/mti-malta/malta-setup.c | 6 ------ 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 3de85be..e2c571d 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -444,6 +445,8 @@ asmlinkage void do_be(struct pt_regs *regs) if (board_be_handler) action = board_be_handler(regs, fixup != NULL); + else + mips_cm_error_report(); switch (action) { case MIPS_BE_DISCARD: diff --git a/arch/mips/mti-malta/malta-int.c b/arch/mips/mti-malta/malta-int.c index c6a6c7a..548130d 100644 --- a/arch/mips/mti-malta/malta-int.c +++ b/arch/mips/mti-malta/malta-int.c @@ -376,18 +376,3 @@ void __init arch_init_irq(void) setup_irq(i8259_irq, &i8259irq); setup_irq(corehi_irq, &corehi_irqaction); } - -void malta_be_init(void) -{ - /* Could change CM error mask register. */ -} - -int malta_be_handler(struct pt_regs *regs, int is_fixup) -{ - /* This duplicates the handling in do_be which seems wrong */ - int retval = is_fixup ? MIPS_BE_FIXUP : MIPS_BE_FATAL; - - mips_cm_error_report(); - - return retval; -} diff --git a/arch/mips/mti-malta/malta-setup.c b/arch/mips/mti-malta/malta-setup.c index d7d151f..2f25930 100644 --- a/arch/mips/mti-malta/malta-setup.c +++ b/arch/mips/mti-malta/malta-setup.c @@ -39,9 +39,6 @@ #include #endif -extern void malta_be_init(void); -extern int malta_be_handler(struct pt_regs *regs, int is_fixup); - static struct resource standard_io_resources[] = { { .name = "dma1", @@ -295,7 +292,4 @@ void __init plat_mem_setup(void) #if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) screen_info_setup(); #endif - - board_be_init = malta_be_init; - board_be_handler = malta_be_handler; } -- 2.9.3