Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e09c510 authored by Nishanth Menon's avatar Nishanth Menon Committed by John Stultz
Browse files

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: default avatarNishanth Menon <nm@ti.com>
parent 0b7503bc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -830,4 +830,8 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
	 /* OTHER_WRITABLE?  Generally considered a bad idea. */		\
	 BUILD_BUG_ON_ZERO((perms) & 2) +					\
	 (perms))

/* To identify board information in panic logs, set this */
extern char *mach_panic_string;

#endif
+8 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@
#define PANIC_TIMER_STEP 100
#define PANIC_BLINK_SPD 18

/* Machine specific panic information string */
char *mach_panic_string;

int panic_on_oops = CONFIG_PANIC_ON_OOPS_VALUE;
static unsigned long tainted_mask;
static int pause_on_oops;
@@ -413,6 +416,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);

	pr_warn("---[ end trace %016llx ]---\n", (unsigned long long)oops_id);
}