X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=kernel%2Fpanic.c;h=4579dbb7ed872a7e1c119fdbbf98d9dc8cd67a87;hb=9aa3d651a9199103eb6451aeb0ac1b66a6d770a6;hp=04e91ff7560b3a35445f006a5be6e1d786bde245;hpb=af0b3152bbfebd3f8291fd61988c12ece4f60f57;p=firefly-linux-kernel-4.4.55.git diff --git a/kernel/panic.c b/kernel/panic.c index 04e91ff7560b..4579dbb7ed87 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -23,6 +23,7 @@ #include #include #include +#include #define PANIC_TIMER_STEP 100 #define PANIC_BLINK_SPD 18 @@ -147,6 +148,15 @@ void panic(const char *fmt, ...) bust_spinlocks(0); + /* + * We may have ended up stopping the CPU holding the lock (in + * smp_send_stop()) while still having some valuable data in the console + * buffer. Try to acquire the lock then release it regardless of the + * result. The release will also print the buffers out. + */ + console_trylock(); + console_unlock(); + if (!panic_blink) panic_blink = no_blink;