alpha: machine check handler for tsunami
Magnus Lindholm
maintainerPATCH v3 1/1 alpha: machine check handler for tsunami
This patch is an attempt to implement a machine check handler with detailed information on error conditions in the event of a machine check exception on the tsunami platform. This work is inspired by how machine check exceptions are handled on the titan family. This patch implements processing of the logout frames that is generated in the event of a machine check. The logout frame contains platform specific information and is helpful in pinpointing the source that triggered the exception or fault. Some faults are recoverable, such as a correctable ECC error, but others may not be possible to recover from. As Alpha hardware is aging we may see more errors due to failing hardware and proper machine check handling can assist in detecting and diagnosing such errors. I hope that someone finds this useful, any feedback is much appreciated. Many thanks to the guys at #gentoo-alpha for the feedback. below is a summary of changes and added files.
This third version of this patch fixes issues with the Makfile that was introduced by previous versions of this patch.
Move functions tsunami_pci_clr_err_1, tsunami_pci_clr_err, tsunami_machine_check to err_tsunami.c and enable pchip errors by seting perrmask in tsunami_init_arch().
Populate the el_TSUNAMI_sysdata_mcheck struct with the tsunami regs in core_tsunami.h
Add err_tsunami.h, which contains error messages and mask used to parse data from logout frames for the tsunami platform.
Add err_tsunami.c, based on err_titan.c and implementing machine check error handling for the tsunami/typhoon based platforms. The tsunami specifics for processing of logout frames is according to Tsunami/Typhoon 21272 Chipset Hardware Reference Manual and AlphaServer ES40 Service Guide: EK-ES239-SV A01
Add err_ev6 and err_tsunami obj files for CONFIG_ALPHA_TSUNAMI in Makefile
Add function declaration for err_tsunami.c to err_impl.h
In sys_dp264.c, install handlers for processing logout frames from SRM console on the tsunami platform.
--- arch/alpha/include/asm/core_tsunami.h | 7 + arch/alpha/kernel/Makefile | 5 +- arch/alpha/kernel/core_tsunami.c | 37 +- arch/alpha/kernel/err_impl.h | 8 + arch/alpha/kernel/err_tsunami.c | 707 ++++++++++++++++++++++++++ arch/alpha/kernel/err_tsunami.h | 199 ++++++++ arch/alpha/kernel/sys_dp264.c | 17 +- 7 files changed, 943 insertions(+), 37 deletions(-) create mode 100644 arch/alpha/kernel/err_tsunami.c create mode 100644 arch/alpha/kernel/err_tsunami.h
arch/alpha/include/asm/core_tsunami.h +7 -0
@@ -283,6 +283,13 @@ union TPchipPERRMASK {* Data structure for handling TSUNAMI machine checks: */ struct el_TSUNAMI_sysdata_mcheck { + +u64 sesf; +u64 dir; +u64 misc; +u64 p0_perror; +u64 p1_perror; + };
arch/alpha/kernel/Makefile +3 -2
@@ -38,7 +38,7 @@ obj-y += err_ev7.o err_titan.o err_marvel.o endif obj-y += irq_pyxis.o irq_i8259.o irq_srm.o -obj-y += err_ev6.o +obj-y += err_ev6.o err_tsunami.o obj-y += es1888.o smc37c669.o smc37c93x.o pc873xx.o gct.o obj-y += srmcons.o
@@ -87,5 +87,6 @@ obj-$(CONFIG_ALPHA_WILDFIRE) += sys_wildfire.o irq_i8259.o obj-$(CONFIG_ALPHA_MARVEL) += err_ev7.o err_marvel.o obj-$(CONFIG_ALPHA_NAUTILUS) += err_ev6.o obj-$(CONFIG_ALPHA_TITAN) += err_ev6.o err_titan.o - +obj-$(CONFIG_ALPHA_DP264) += err_ev6.o err_tsunami.o +obj-$(CONFIG_ALPHA_EIGER) += err_ev6.o err_tsunami.o endif # GENERIC
arch/alpha/kernel/core_tsunami.c +3 -34
@@ -346,6 +346,9 @@ tsunami_init_one_pchip(tsunami_pchip *pchip, int index) pchip->wsba[3 ].csr =0 ; +/* Enable pchip error */ + pchip->perrmask.csr =0x0fff ; +/* Enable the Monster Window to make DAC pci64 possible. */ pchip->pctl.csr |= pctl_m_mwin;
@@ -448,37 +451,3 @@ tsunami_kill_arch(int mode)if (TSUNAMI_cchip->csc.csr &1L <<14 )tsunami_kill_one_pchip (TSUNAMI_pchip1,1 ); } - -static inline void -tsunami_pci_clr_err_1 (tsunami_pchip *pchip) -{ - pchip->perror.csr; - pchip->perror.csr =0x040 ; -mb (); - pchip->perror.csr; -} - -static inline void -tsunami_pci_clr_err (void ) -{ -tsunami_pci_clr_err_1 (TSUNAMI_pchip0); - -/* TSUNAMI and TYPHOON can have 2, but might only have 1 (DS10) */ -if (TSUNAMI_cchip->csc.csr &1L <<14 ) -tsunami_pci_clr_err_1 (TSUNAMI_pchip1); -} - -void -tsunami_machine_check (unsigned long vector,unsigned long la_ptr) -{ -/* Clear error before any reporting. */ -mb (); -mb ();/* magic */ -draina (); -tsunami_pci_clr_err (); -wrmces (0x7 ); -mb (); - -process_mcheck_info (vector, la_ptr,"TSUNAMI" , -mcheck_expected (smp_processor_id ())); -}
arch/alpha/kernel/err_impl.h +8 -0
@@ -86,3 +86,11 @@ extern void titan_machine_check(unsigned long, unsigned long);extern void titan_register_error_handlers (void );extern int privateer_process_logout_frame (struct el_common *,int );extern void privateer_machine_check (unsigned long ,unsigned long ); + +/* +* err_tsunami.c +*/ +extern void tsunami_register_error_handlers (void ); +extern int tsunami_process_logout_frame (struct el_common *mchk_header,int print); +extern void tsunami_machine_check (unsigned long vector,unsigned long la_ptr); +extern int clipper_process_logout_frame (struct el_common *mchk_header,int print);
arch/alpha/kernel/err_tsunami.c new file +707 -0
707 lines not on this page · raw message
arch/alpha/kernel/err_tsunami.h new file +199 -0
199 lines not on this page · raw message
arch/alpha/kernel/sys_dp264.c +16 -1
@@ -34,7 +34,7 @@#include "irq_impl.h" #include "pci_impl.h" #include "machvec_impl.h" - +#include "err_impl.h" /* Note mask bit is true for ENABLED irqs. */ static unsigned long cached_irq_mask;
@@ -282,6 +282,15 @@ dp264_init_irq(void)init_i8259a_irqs ();init_tsunami_irqs (&dp264_irq_type,16 ,47 ); } +static void __init +tsunami_late_init (void ) +{ +tsunami_register_error_handlers (); +/* +* Check if the console left us any error logs. +*/ +cdl_check_console_data_log (); +}static void __init clipper_init_irq (void )
@@ -521,6 +530,12 @@ monet_init_pci(void)static void __init clipper_init_pci (void ) { +/* +* This isn't really the right place, but there's some init +* that needs to be done after everything is basically up. +*/ +tsunami_late_init (); +common_init_pci ();locate_and_init_vga (NULL ); }
Signature · 1 line
2.45.3