--- zzzz-none-000/linux-5.4.213/kernel/printk/printk_safe.c 2022-09-15 10:04:56.000000000 +0000 +++ alder-5690pro-762/linux-5.4.213/kernel/printk/printk_safe.c 2024-08-14 09:02:11.000000000 +0000 @@ -11,6 +11,8 @@ #include #include +#include + #include "internal.h" /* @@ -273,7 +275,7 @@ return; debug_locks_off(); - raw_spin_lock_init(&logbuf_lock); + __raw_rte_raw_spin_lock_init(&logbuf_lock); } if (raw_spin_is_locked(&safe_read_lock)) { @@ -281,7 +283,7 @@ return; debug_locks_off(); - raw_spin_lock_init(&safe_read_lock); + __raw_rte_raw_spin_lock_init(&safe_read_lock); } printk_safe_flush(); @@ -367,16 +369,18 @@ __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { + unsigned long flags; + /* * Try to use the main logbuf even in NMI. But avoid calling console * drivers that might have their own locks. */ if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK) && - raw_spin_trylock(&logbuf_lock)) { + __raw_rte_raw_spin_trylock_irqsave(&logbuf_lock, flags)) { int len; len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, 0, fmt, args); - raw_spin_unlock(&logbuf_lock); + __raw_rte_raw_spin_unlock_irqrestore(&logbuf_lock, flags); defer_console_output(); return len; }