summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2011-10-09 02:32:39 +0100
committerAndy Green <andy.green@linaro.org>2011-10-09 02:32:39 +0100
commit5b5f11c110f7bcadfdac0d746907b2b2c4867d3b (patch)
tree91e056023383f8ffa6c5d55f68300e0ce32147bb
parent5e9bce58b9d39f30938a8f0046f7172e43ec61cb (diff)
panic: Add board ID to panic output
At times, it is necessary for boards to provide some additional information as part of panic logs. Provide information on the board hardware as part of panic logs. It is safer to print this information at the very end in case something bad happens as part of the information retrieval itself. To use this, set global mach_panic_string to an appropriate string in the board file. Change-Id: Id12cdda87b0cd2940dd01d52db97e6162f671b4d Signed-off-by: Nishanth Menon <nm@ti.com>
-rw-r--r--include/linux/kernel.h3
-rw-r--r--kernel/panic.c8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 46ac9a50528..54bf5a471e1 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -744,4 +744,7 @@ struct sysinfo {
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
};
+/* To identify board information in panic logs, set this */
+extern char *mach_panic_string;
+
#endif
diff --git a/kernel/panic.c b/kernel/panic.c
index cdb86b12832..41fc78ea3db 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -27,6 +27,9 @@
#define PANIC_TIMER_STEP 100
#define PANIC_BLINK_SPD 18
+/* Machine specific panic information string */
+char *mach_panic_string;
+
int panic_on_oops;
static unsigned long tainted_mask;
static int pause_on_oops;
@@ -347,6 +350,11 @@ late_initcall(init_oops_id);
void print_oops_end_marker(void)
{
init_oops_id();
+
+ if (mach_panic_string)
+ printk(KERN_WARNING "Board Information: %s\n",
+ mach_panic_string);
+
printk(KERN_WARNING "---[ end trace %016llx ]---\n",
(unsigned long long)oops_id);
}