android_kernel_xiaomi_sm8350/lib/bust_spinlocks.c
Viktor Rosendahl b61312d353 oops handling: ensure that any oops is flushed to the mtdoops console
This used to work unpatched with older kernels, during the development
phase of mtdoops.  Before commit e3e8a75d2a
a space was printed with console_loglevel set to 15, which probably
flushed the oops message as a side effect.

This is another patch from the Nokia N810 kernel.

Signed-off-by: Viktor Rosendahl <viktor.rosendahl@nokia.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-06 15:59:11 -08:00

33 lines
636 B
C

/*
* lib/bust_spinlocks.c
*
* Provides a minimal bust_spinlocks for architectures which don't have one of their own.
*
* bust_spinlocks() clears any spinlocks which would prevent oops, die(), BUG()
* and panic() information from reaching the user.
*/
#include <linux/kernel.h>
#include <linux/spinlock.h>
#include <linux/tty.h>
#include <linux/wait.h>
#include <linux/vt_kern.h>
#include <linux/console.h>
void __attribute__((weak)) bust_spinlocks(int yes)
{
if (yes) {
++oops_in_progress;
} else {
#ifdef CONFIG_VT
unblank_screen();
#endif
console_unblank();
if (--oops_in_progress == 0)
wake_up_klogd();
}
}