mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
wake_up_klogd() is useless when CONFIG_PRINTK=n because neither printk() nor printk_sched() are in use and there are actually no waiter on log_wait waitqueue. It should be a stub in this case for users like bust_spinlocks(). Otherwise this results in this warning when CONFIG_PRINTK=n and CONFIG_IRQ_WORK=n: kernel/built-in.o In function `wake_up_klogd': (.text.wake_up_klogd+0xb4): undefined reference to `irq_work_queue' To fix this, provide an off-case for wake_up_klogd() when CONFIG_PRINTK=n. There is much more from console_unlock() and other console related code in printk.c that should be moved under CONFIG_PRINTK. But for now, focus on a minimal fix as we passed the merged window already. [[email protected]: include printk.h in bust_spinlocks.c] Signed-off-by: Frederic Weisbecker <[email protected]> Reported-by: James Hogan <[email protected]> Cc: James Hogan <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
32 lines
660 B
C
32 lines
660 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/printk.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();
|
|
}
|
|
}
|