“75497d96b2094d325594b46d5e5f12b2396c4d51”上不存在“README.md”
  • F
    printk: Provide a wake_up_klogd() off-case · dc72c32e
    Frederic Weisbecker 提交于
    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.
    
    [akpm@linux-foundation.org: include printk.h in bust_spinlocks.c]
    Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
    Reported-by: NJames Hogan <james.hogan@imgtec.com>
    Cc: James Hogan <james.hogan@imgtec.com>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Ingo Molnar <mingo@kernel.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    dc72c32e
bust_spinlocks.c 660 字节
/*
 * 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();
	}
}
反馈
建议
客服 返回
顶部