Commit 353cc80d authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Richard Henderson

[PATCH] alpha: common ev6/ev7 machine check handler

Here is new ev6/ev7 machine check parser, which is a part of Jeff's
titan/marvel patchset.
Instead of fixing nautilus machine check handler, I've converted it
to use this new code.  Works fine.
Also, the CONFIG_VERBOSE_MCHECK is good for cia/pyxis - the detailed
error reporting is completely useless unless you have faulty CPU or RAM.

Ivan.
parent 68c1e696
...@@ -522,6 +522,9 @@ config ALPHA_LARGE_VMALLOC ...@@ -522,6 +522,9 @@ config ALPHA_LARGE_VMALLOC
Say N unless you know you need gobs and gobs of vmalloc space. Say N unless you know you need gobs and gobs of vmalloc space.
config VERBOSE_MCHECK
bool "Verbose Machine Checks"
source "drivers/pci/Kconfig" source "drivers/pci/Kconfig"
config HOTPLUG config HOTPLUG
......
...@@ -59,6 +59,7 @@ CONFIG_ALPHA_GENERIC=y ...@@ -59,6 +59,7 @@ CONFIG_ALPHA_GENERIC=y
# CONFIG_ALPHA_TAKARA is not set # CONFIG_ALPHA_TAKARA is not set
# CONFIG_ALPHA_TITAN is not set # CONFIG_ALPHA_TITAN is not set
# CONFIG_ALPHA_WILDFIRE is not set # CONFIG_ALPHA_WILDFIRE is not set
CONFIG_VERBOSE_MCHECK=y
CONFIG_ISA=y CONFIG_ISA=y
CONFIG_EISA=y CONFIG_EISA=y
# CONFIG_SBUS is not set # CONFIG_SBUS is not set
......
...@@ -10,7 +10,7 @@ export-objs := alpha_ksyms.o ...@@ -10,7 +10,7 @@ export-objs := alpha_ksyms.o
obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
irq_alpha.o signal.o setup.o ptrace.o time.o semaphore.o \ irq_alpha.o signal.o setup.o ptrace.o time.o semaphore.o \
alpha_ksyms.o systbls.o alpha_ksyms.o systbls.o err_common.o
# #
# FIXME! # FIXME!
......
...@@ -755,6 +755,7 @@ cia_pci_clr_err(void) ...@@ -755,6 +755,7 @@ cia_pci_clr_err(void)
*(vip)CIA_IOC_CIA_ERR; /* re-read to force write. */ *(vip)CIA_IOC_CIA_ERR; /* re-read to force write. */
} }
#ifdef CONFIG_VERBOSE_MCHECK
static void static void
cia_decode_pci_error(struct el_CIA_sysdata_mcheck *cia, const char *msg) cia_decode_pci_error(struct el_CIA_sysdata_mcheck *cia, const char *msg)
{ {
...@@ -1022,13 +1023,13 @@ cia_decode_parity_error(struct el_CIA_sysdata_mcheck *cia) ...@@ -1022,13 +1023,13 @@ cia_decode_parity_error(struct el_CIA_sysdata_mcheck *cia)
printk(KERN_CRIT " Command: %s, Parity bit: %d\n", cmd, par); printk(KERN_CRIT " Command: %s, Parity bit: %d\n", cmd, par);
printk(KERN_CRIT " Address: %#010lx, Mask: %#lx\n", addr, mask); printk(KERN_CRIT " Address: %#010lx, Mask: %#lx\n", addr, mask);
} }
#endif
static int static int
cia_decode_mchk(unsigned long la_ptr) cia_decode_mchk(unsigned long la_ptr)
{ {
struct el_common *com; struct el_common *com;
struct el_CIA_sysdata_mcheck *cia; struct el_CIA_sysdata_mcheck *cia;
int which;
com = (void *)la_ptr; com = (void *)la_ptr;
cia = (void *)(la_ptr + com->sys_offset); cia = (void *)(la_ptr + com->sys_offset);
...@@ -1036,8 +1037,8 @@ cia_decode_mchk(unsigned long la_ptr) ...@@ -1036,8 +1037,8 @@ cia_decode_mchk(unsigned long la_ptr)
if ((cia->cia_err & CIA_ERR_VALID) == 0) if ((cia->cia_err & CIA_ERR_VALID) == 0)
return 0; return 0;
which = cia->cia_err & 0xfff; #ifdef CONFIG_VERBOSE_MCHECK
switch (ffs(which) - 1) { switch (ffs(cia->cia_err & 0xfff) - 1) {
case 0: /* CIA_ERR_COR_ERR */ case 0: /* CIA_ERR_COR_ERR */
cia_decode_ecc_error(cia, "Corrected ECC error"); cia_decode_ecc_error(cia, "Corrected ECC error");
break; break;
...@@ -1109,6 +1110,7 @@ cia_decode_mchk(unsigned long la_ptr) ...@@ -1109,6 +1110,7 @@ cia_decode_mchk(unsigned long la_ptr)
if (cia->cia_err & CIA_ERR_LOST_IOA_TIMEOUT) if (cia->cia_err & CIA_ERR_LOST_IOA_TIMEOUT)
printk(KERN_CRIT "CIA lost machine check: " printk(KERN_CRIT "CIA lost machine check: "
"I/O timeout\n"); "I/O timeout\n");
#endif
return 1; return 1;
} }
......
This diff is collapsed.
/*
* linux/arch/alpha/kernel/err_impl.h
*
* Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
*
* Contains declarations and macros to support Alpha error handling
* implementations.
*/
/*
* SCB Vector definitions
*/
#define SCB_Q_SYSERR 0x620
#define SCB_Q_PROCERR 0x630
#define SCB_Q_SYSMCHK 0x660
#define SCB_Q_PROCMCHK 0x670
#define SCB_Q_SYSEVENT 0x680
/*
* Disposition definitions for logout frame parser
*/
#define MCHK_DISPOSITION_UNKNOWN_ERROR 0x00
#define MCHK_DISPOSITION_REPORT 0x01
#define MCHK_DISPOSITION_DISMISS 0x02
/*
* Error Log definitions
*/
/*
* Types
*/
#define EL_CLASS__TERMINATION (0)
# define EL_TYPE__TERMINATION__TERMINATION (0)
#define EL_CLASS__HEADER (5)
# define EL_TYPE__HEADER__SYSTEM_ERROR_FRAME (1)
# define EL_TYPE__HEADER__SYSTEM_EVENT_FRAME (2)
# define EL_TYPE__HEADER__HALT_FRAME (3)
# define EL_TYPE__HEADER__LOGOUT_FRAME (19)
#define EL_CLASS__GENERAL_NOTIFICATION (9)
#define EL_CLASS__PCI_ERROR_FRAME (11)
#define EL_CLASS__REGATTA_FAMILY (12)
# define EL_TYPE__REGATTA__PROCESSOR_ERROR_FRAME (1)
# define EL_TYPE__REGATTA__SYSTEM_ERROR_FRAME (2)
# define EL_TYPE__REGATTA__ENVIRONMENTAL_FRAME (3)
# define EL_TYPE__REGATTA__TITAN_PCHIP0_EXTENDED (8)
# define EL_TYPE__REGATTA__TITAN_PCHIP1_EXTENDED (9)
# define EL_TYPE__REGATTA__TITAN_MEMORY_EXTENDED (10)
# define EL_TYPE__REGATTA__PROCESSOR_DBL_ERROR_HALT (11)
# define EL_TYPE__REGATTA__SYSTEM_DBL_ERROR_HALT (12)
#define EL_CLASS__PAL (14)
# define EL_TYPE__PAL__LOGOUT_FRAME (1)
# define EL_TYPE__PAL__EV7_PROCESSOR (4)
# define EL_TYPE__PAL__EV7_ZBOX (5)
# define EL_TYPE__PAL__EV7_RBOX (6)
# define EL_TYPE__PAL__EV7_IO (7)
union el_timestamp {
struct {
u8 second;
u8 minute;
u8 hour;
u8 day;
u8 month;
u8 year;
} b;
u64 as_int;
};
struct el_subpacket {
u16 length; /* length of header (in bytes) */
u16 class; /* header class and type... */
u16 type; /* ...determine content */
u16 revision; /* header revision */
union {
struct { /* Class 5, Type 1 - System Error */
u32 frame_length;
u32 frame_packet_count;
} sys_err;
struct { /* Class 5, Type 2 - System Event */
union el_timestamp timestamp;
u32 frame_length;
u32 frame_packet_count;
} sys_event;
struct { /* Class 5, Type 3 - Double Error Halt */
u16 halt_code;
u16 reserved;
union el_timestamp timestamp;
u32 frame_length;
u32 frame_packet_count;
} err_halt;
struct { /* Clasee 5, Type 19 - Logout Frame Header */
u32 frame_length;
u32 frame_flags;
u32 cpu_offset;
u32 system_offset;
} logout_header;
struct { /* Class 12 - Regatta */
u64 cpuid;
u64 data_start[1];
} regatta_frame;
struct { /* Raw */
u64 data_start[1];
} raw;
} by_type;
};
struct el_subpacket_annotation {
struct el_subpacket_annotation *next;
u16 class;
u16 type;
u16 revision;
char *description;
char **annotation;
};
#define SUBPACKET_ANNOTATION(c, t, r, d, a) {NULL, (c), (t), (r), (d), (a)}
struct el_subpacket_handler {
struct el_subpacket_handler *next;
u16 class;
struct el_subpacket *(*handler)(struct el_subpacket *);
};
#define SUBPACKET_HANDLER_INIT(c, h) {NULL, (c), (h)}
/*
* Extract a field from a register given it's name. defines
* for the LSB (__S - shift count) and bitmask (__M) are required
*/
#define EXTRACT(u, f) (((u) >> f##__S) & f##__M)
/*
* err_common.c
*/
extern char *err_print_prefix;
extern void mchk_dump_mem(void *, int, char **);
extern void mchk_dump_logout_frame(struct el_common *);
extern void ev7_register_error_handlers(void);
extern void ev7_machine_check(u64, u64, struct pt_regs *);
extern void ev6_register_error_handlers(void);
extern int ev6_process_logout_frame(struct el_common *, int);
extern void ev6_machine_check(u64, u64, struct pt_regs *);
extern struct el_subpacket *el_process_subpacket(struct el_subpacket *);
extern void el_annotate_subpacket(struct el_subpacket *);
extern void cdl_check_console_data_log(void);
extern int cdl_register_subpacket_annotation(struct el_subpacket_annotation *);
extern int cdl_register_subpacket_handler(struct el_subpacket_handler *);
...@@ -147,10 +147,10 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr, ...@@ -147,10 +147,10 @@ process_mcheck_info(unsigned long vector, unsigned long la_ptr,
mchk_header = (struct el_common *)la_ptr; mchk_header = (struct el_common *)la_ptr;
printk(KERN_CRIT "%s machine check: vector=0x%lx pc=0x%lx code=0x%lx\n", printk(KERN_CRIT "%s machine check: vector=0x%lx pc=0x%lx code=0x%x\n",
machine, vector, regs->pc, mchk_header->code); machine, vector, regs->pc, mchk_header->code);
switch ((unsigned int) mchk_header->code) { switch (mchk_header->code) {
/* Machine check reasons. Defined according to PALcode sources. */ /* Machine check reasons. Defined according to PALcode sources. */
case 0x80: reason = "tag parity error"; break; case 0x80: reason = "tag parity error"; break;
case 0x82: reason = "tag control parity error"; break; case 0x82: reason = "tag control parity error"; break;
......
This diff is collapsed.
...@@ -109,6 +109,9 @@ struct percpu_struct { ...@@ -109,6 +109,9 @@ struct percpu_struct {
unsigned long ipc_buffer[21]; unsigned long ipc_buffer[21];
unsigned long palcode_avail[16]; unsigned long palcode_avail[16];
unsigned long compatibility; unsigned long compatibility;
unsigned long console_data_log_pa;
unsigned long console_data_log_length;
unsigned long bcache_info;
}; };
struct procdesc_struct { struct procdesc_struct {
......
...@@ -61,7 +61,8 @@ struct el_common { ...@@ -61,7 +61,8 @@ struct el_common {
int retry : 1; /* retry flag */ int retry : 1; /* retry flag */
unsigned int proc_offset; /* processor-specific offset */ unsigned int proc_offset; /* processor-specific offset */
unsigned int sys_offset; /* system-specific offset */ unsigned int sys_offset; /* system-specific offset */
unsigned long code; /* machine check code */ unsigned int code; /* machine check code */
unsigned int frame_rev; /* frame revision */
}; };
/* Machine Check Frame for uncorrectable errors (Large format) /* Machine Check Frame for uncorrectable errors (Large format)
...@@ -117,11 +118,11 @@ struct el_common_EV6_mcheck { ...@@ -117,11 +118,11 @@ struct el_common_EV6_mcheck {
unsigned long DC0_SYNDROME; unsigned long DC0_SYNDROME;
unsigned long C_STAT; unsigned long C_STAT;
unsigned long C_STS; unsigned long C_STS;
unsigned long RESERVED0; unsigned long MM_STAT;
unsigned long EXC_ADDR; unsigned long EXC_ADDR;
unsigned long IER_CM; unsigned long IER_CM;
unsigned long ISUM; unsigned long ISUM;
unsigned long MM_STAT; unsigned long RESERVED0;
unsigned long PAL_BASE; unsigned long PAL_BASE;
unsigned long I_CTL; unsigned long I_CTL;
unsigned long PCTX; unsigned long PCTX;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment