2 * linux/arch/alpha/kernel/err_ev6.c
4 * Copyright (C) 2000 Jeff Wiedemeier (Compaq Computer Corporation)
6 * Error handling code supporting Alpha systems
9 #include <linux/sched.h>
12 #include <asm/irq_regs.h>
13 #include <asm/hwrpb.h>
15 #include <asm/err_common.h>
16 #include <asm/err_ev6.h>
22 ev6_parse_ibox(u64 i_stat, int print)
24 int status = MCHK_DISPOSITION_REPORT;
26 #define EV6__I_STAT__PAR (1UL << 29)
27 #define EV6__I_STAT__ERRMASK (EV6__I_STAT__PAR)
29 if (!(i_stat & EV6__I_STAT__ERRMASK))
30 return MCHK_DISPOSITION_UNKNOWN_ERROR;
35 if (i_stat & EV6__I_STAT__PAR)
36 printk("%s Icache parity error\n", err_print_prefix);
42 ev6_parse_mbox(u64 mm_stat, u64 d_stat, u64 c_stat, int print)
44 int status = MCHK_DISPOSITION_REPORT;
46 #define EV6__MM_STAT__DC_TAG_PERR (1UL << 10)
47 #define EV6__MM_STAT__ERRMASK (EV6__MM_STAT__DC_TAG_PERR)
48 #define EV6__D_STAT__TPERR_P0 (1UL << 0)
49 #define EV6__D_STAT__TPERR_P1 (1UL << 1)
50 #define EV6__D_STAT__ECC_ERR_ST (1UL << 2)
51 #define EV6__D_STAT__ECC_ERR_LD (1UL << 3)
52 #define EV6__D_STAT__SEO (1UL << 4)
53 #define EV6__D_STAT__ERRMASK (EV6__D_STAT__TPERR_P0 | \
54 EV6__D_STAT__TPERR_P1 | \
55 EV6__D_STAT__ECC_ERR_ST | \
56 EV6__D_STAT__ECC_ERR_LD | \
59 if (!(d_stat & EV6__D_STAT__ERRMASK) &&
60 !(mm_stat & EV6__MM_STAT__ERRMASK))
61 return MCHK_DISPOSITION_UNKNOWN_ERROR;
66 if (mm_stat & EV6__MM_STAT__DC_TAG_PERR)
67 printk("%s Dcache tag parity error on probe\n",
69 if (d_stat & EV6__D_STAT__TPERR_P0)
70 printk("%s Dcache tag parity error - pipe 0\n",
72 if (d_stat & EV6__D_STAT__TPERR_P1)
73 printk("%s Dcache tag parity error - pipe 1\n",
75 if (d_stat & EV6__D_STAT__ECC_ERR_ST)
76 printk("%s ECC error occurred on a store\n",
78 if (d_stat & EV6__D_STAT__ECC_ERR_LD)
79 printk("%s ECC error occurred on a %s load\n",
81 c_stat ? "" : "speculative ");
82 if (d_stat & EV6__D_STAT__SEO)
83 printk("%s Dcache second error\n", err_print_prefix);
89 ev6_parse_cbox(u64 c_addr, u64 c1_syn, u64 c2_syn,
90 u64 c_stat, u64 c_sts, int print)
92 static const char * const sourcename[] = {
93 "UNKNOWN", "UNKNOWN", "UNKNOWN",
94 "MEMORY", "BCACHE", "DCACHE",
95 "BCACHE PROBE", "BCACHE PROBE"
97 static const char * const streamname[] = { "D", "I" };
98 static const char * const bitsname[] = { "SINGLE", "DOUBLE" };
99 int status = MCHK_DISPOSITION_REPORT;
100 int source = -1, stream = -1, bits = -1;
102 #define EV6__C_STAT__BC_PERR (0x01)
103 #define EV6__C_STAT__DC_PERR (0x02)
104 #define EV6__C_STAT__DSTREAM_MEM_ERR (0x03)
105 #define EV6__C_STAT__DSTREAM_BC_ERR (0x04)
106 #define EV6__C_STAT__DSTREAM_DC_ERR (0x05)
107 #define EV6__C_STAT__PROBE_BC_ERR0 (0x06) /* both 6 and 7 indicate... */
108 #define EV6__C_STAT__PROBE_BC_ERR1 (0x07) /* ...probe bc error. */
109 #define EV6__C_STAT__ISTREAM_MEM_ERR (0x0B)
110 #define EV6__C_STAT__ISTREAM_BC_ERR (0x0C)
111 #define EV6__C_STAT__DSTREAM_MEM_DBL (0x13)
112 #define EV6__C_STAT__DSTREAM_BC_DBL (0x14)
113 #define EV6__C_STAT__ISTREAM_MEM_DBL (0x1B)
114 #define EV6__C_STAT__ISTREAM_BC_DBL (0x1C)
115 #define EV6__C_STAT__SOURCE_MEMORY (0x03)
116 #define EV6__C_STAT__SOURCE_BCACHE (0x04)
117 #define EV6__C_STAT__SOURCE__S (0)
118 #define EV6__C_STAT__SOURCE__M (0x07)
119 #define EV6__C_STAT__ISTREAM__S (3)
120 #define EV6__C_STAT__ISTREAM__M (0x01)
121 #define EV6__C_STAT__DOUBLE__S (4)
122 #define EV6__C_STAT__DOUBLE__M (0x01)
123 #define EV6__C_STAT__ERRMASK (0x1F)
124 #define EV6__C_STS__SHARED (1 << 0)
125 #define EV6__C_STS__DIRTY (1 << 1)
126 #define EV6__C_STS__VALID (1 << 2)
127 #define EV6__C_STS__PARITY (1 << 3)
129 if (!(c_stat & EV6__C_STAT__ERRMASK))
130 return MCHK_DISPOSITION_UNKNOWN_ERROR;
135 source = EXTRACT(c_stat, EV6__C_STAT__SOURCE);
136 stream = EXTRACT(c_stat, EV6__C_STAT__ISTREAM);
137 bits = EXTRACT(c_stat, EV6__C_STAT__DOUBLE);
139 if (c_stat & EV6__C_STAT__BC_PERR) {
140 printk("%s Bcache tag parity error\n", err_print_prefix);
144 if (c_stat & EV6__C_STAT__DC_PERR) {
145 printk("%s Dcache tag parity error\n", err_print_prefix);
149 if (c_stat == EV6__C_STAT__PROBE_BC_ERR0 ||
150 c_stat == EV6__C_STAT__PROBE_BC_ERR1) {
151 printk("%s Bcache single-bit error on a probe hit\n",
157 printk("%s %s-STREAM %s-BIT ECC error from %s\n",
159 streamname[stream], bitsname[bits], sourcename[source]);
161 printk("%s Address: 0x%016llx\n"
162 " Syndrome[upper.lower]: %02llx.%02llx\n",
167 if (source == EV6__C_STAT__SOURCE_MEMORY ||
168 source == EV6__C_STAT__SOURCE_BCACHE)
169 printk("%s Block status: %s%s%s%s\n",
171 (c_sts & EV6__C_STS__SHARED) ? "SHARED " : "",
172 (c_sts & EV6__C_STS__DIRTY) ? "DIRTY " : "",
173 (c_sts & EV6__C_STS__VALID) ? "VALID " : "",
174 (c_sts & EV6__C_STS__PARITY) ? "PARITY " : "");
180 ev6_register_error_handlers(void)
182 /* None right now. */
186 ev6_process_logout_frame(struct el_common *mchk_header, int print)
188 struct el_common_EV6_mcheck *ev6mchk =
189 (struct el_common_EV6_mcheck *)mchk_header;
190 int status = MCHK_DISPOSITION_UNKNOWN_ERROR;
192 status |= ev6_parse_ibox(ev6mchk->I_STAT, print);
193 status |= ev6_parse_mbox(ev6mchk->MM_STAT, ev6mchk->DC_STAT,
194 ev6mchk->C_STAT, print);
195 status |= ev6_parse_cbox(ev6mchk->C_ADDR, ev6mchk->DC1_SYNDROME,
196 ev6mchk->DC0_SYNDROME, ev6mchk->C_STAT,
197 ev6mchk->C_STS, print);
202 if (status != MCHK_DISPOSITION_DISMISS) {
203 char *saved_err_prefix = err_print_prefix;
206 * Dump some additional information from the frame
208 printk("%s EXC_ADDR: 0x%016lx IER_CM: 0x%016lx"
210 " PAL_BASE: 0x%016lx I_CTL: 0x%016lx"
213 ev6mchk->EXC_ADDR, ev6mchk->IER_CM, ev6mchk->ISUM,
214 ev6mchk->PAL_BASE, ev6mchk->I_CTL, ev6mchk->PCTX);
216 if (status == MCHK_DISPOSITION_UNKNOWN_ERROR) {
217 printk("%s UNKNOWN error, frame follows:\n",
220 /* had decode -- downgrade print level for frame */
221 err_print_prefix = KERN_NOTICE;
224 mchk_dump_logout_frame(mchk_header);
226 err_print_prefix = saved_err_prefix;
233 ev6_machine_check(unsigned long vector, unsigned long la_ptr)
235 struct el_common *mchk_header = (struct el_common *)la_ptr;
244 * Parse the logout frame without printing first. If the only error(s)
245 * found are have a disposition of "dismiss", then just dismiss them
246 * and don't print any message
248 if (ev6_process_logout_frame(mchk_header, 0) !=
249 MCHK_DISPOSITION_DISMISS) {
250 char *saved_err_prefix = err_print_prefix;
251 err_print_prefix = KERN_CRIT;
254 * Either a nondismissable error was detected or no
255 * recognized error was detected in the logout frame
256 * -- report the error in either case
258 printk("%s*CPU %s Error (Vector 0x%x) reported on CPU %d:\n",
260 (vector == SCB_Q_PROCERR)?"Correctable":"Uncorrectable",
261 (unsigned int)vector, (int)smp_processor_id());
263 ev6_process_logout_frame(mchk_header, 1);
264 dik_show_regs(get_irq_regs(), NULL);
266 err_print_prefix = saved_err_prefix;
270 * Release the logout frame