2 * arch/ppc/kernel/error_log.c
4 * Copyright (c) 2000 Tilmann Bitterberg
5 * (tilmann@bitterberg.de)
7 * Error processing of errors found by rtas even-scan routine
8 * which is done with every heartbeat. (chrp_setup.c)
11 #include <linux/sched.h>
15 #include "error_log.h"
17 /* ****************************************************************** */
20 * The whole stuff below here doesn't take any action when it found
21 * an error, it just prints as much information as possible and
22 * then its up to the user to decide what to do.
24 * Returns 0 if no errors were found
25 * Returns 1 if there may be more errors
27 int ppc_rtas_errorlog_scan(void)
29 const char *_errlog_severity[] = {
32 Should require no further information",
34 This is not really an error, it is an event. I use events\n\t\
35 to communicate with RTAS back and forth.",
37 Indicates a non-state-losing error, either fully recovered\n\t\
38 by RTAS or not needing recovery. Ignore it.",
40 May only be fatal to a certain program or thread. Recovery\n\t\
41 and continuation is possible, if I only had a handler for\n\t\
44 Less serious, but still causing a loss of data and state.\n\t\
45 I can't tell you exactly what to do, You have to decide\n\t\
46 with help from the target and initiator field, what kind\n\t\
47 of further actions may take place.",
49 Represent a permanent hardware failure and I believe this\n\t\
50 affects my overall performance and behaviour. I would not\n\t\
51 attempt to continue normal operation."
59 #endif /* VERBOSE_ERRORS */
63 const char *_errlog_disposition[] = {
66 There was an error, but it is fully recovered by RTAS.",
67 "Limited recovery\n\t\
68 RTAS was able to recover the state of the machine, but some\n\t\
69 feature of the machine has been disabled or lost (for example\n\t\
70 error checking) or performance may suffer.",
72 Whether RTAS did not try to recover anything or recovery failed:\n\t\
73 HOUSTON, WE HAVE A PROBLEM!"
78 #endif /* VERBOSE_ERRORS */
82 const char *_errlog_extended[] = {
85 Sad, the RTAS call didn't return an extended error log.",
87 The extended log is present and hopefully it contains a lot of\n\t\
88 useful information, which leads to the solution of the problem."
92 #endif /* VERBOSE_ERRORS */
95 const char *_errlog_initiator[] = {
96 "Unknown or not applicable",
104 const char *_errlog_target[] = {
105 "Unknown or not applicable",
112 rtas_error_log error_log;
116 int retries = 0; /* if HW error, try 10 times */
119 error = call_rtas ("event-scan", 4, 1, (unsigned long *)&error_log,
120 INTERNAL_ERROR | EPOW_WARNING,
121 0, __pa(logdata), 1024);
123 if (error == 1) /* no errors found */
127 printk(KERN_ERR "Unable to get errors. Do you a favor and throw this box away\n");
130 if (error_log.version != 1)
131 printk(KERN_WARNING "Unknown version (%d), please implement me\n",
134 switch (error_log.disposition) {
135 case DISP_FULLY_RECOVERED:
136 /* there was an error, but everything is fine now */
138 case DISP_NOT_RECOVERED:
139 printk("We have a really serious Problem!\n");
140 case DISP_LIMITED_RECOVERY:
141 printk("Error classification\n");
142 printk("Severity : %s\n",
143 ppc_rtas_errorlog_check_severity (error_log));
144 printk("Initiator : %s\n",
145 ppc_rtas_errorlog_check_initiator (error_log));
146 printk("Target : %s\n",
147 ppc_rtas_errorlog_check_target (error_log));
148 printk("Type : %s\n",
149 ppc_rtas_errorlog_check_type (error_log));
150 printk("Ext. log : %s\n",
151 ppc_rtas_errorlog_check_extended (error_log));
152 if (error_log.extended)
153 ppc_rtas_errorlog_disect_extended (logdata);
161 /* ****************************************************************** */
162 const char * ppc_rtas_errorlog_check_type (rtas_error_log error_log)
164 const char *_errlog_type[] = {
166 "too many tries failed",
168 "RTAS device failed",
170 "parity error on data", /* 5 */
171 "parity error on address",
172 "parity error on external cache",
173 "access to invalid address",
174 "uncorrectable ECC error",
175 "corrected ECC error" /* 10 */
177 if (error_log.type == TYPE_EPOW)
179 if (error_log.type >= TYPE_PMGM_POWER_SW_ON)
180 return "PowerMGM Event (not handled right now)";
181 return _errlog_type[error_log.type];