diff options
| author | Petr Mladek <pmladek@suse.com> | 2025-12-01 14:16:45 +0100 |
|---|---|---|
| committer | Petr Mladek <pmladek@suse.com> | 2025-12-01 14:16:45 +0100 |
| commit | 4f132d81f9f8e47a8866d162698adb7df7184466 (patch) | |
| tree | a45d7073449f9e549d9630f18728e3b3e42753bd /kernel | |
| parent | 3a9a3f5fb224155bb719c337527ffdffca0c1d7f (diff) | |
| parent | 20793955835fe29a5582f68ff031fdcd35cc98ed (diff) | |
Merge branch 'rework/threaded-printk' into for-linus
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/printk/printk.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 54ea492d0c97..7394f1b6033b 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -3023,21 +3023,18 @@ out: } /* - * Legacy console printing from printk() caller context does not respect - * raw_spinlock/spinlock nesting. For !PREEMPT_RT the lockdep warning is a - * false positive. For PREEMPT_RT the false positive condition does not - * occur. - * - * This map is used to temporarily establish LD_WAIT_SLEEP context for the - * console write() callback when legacy printing to avoid false positive - * lockdep complaints, thus allowing lockdep to continue to function for - * real issues. + * The legacy console always acquires a spinlock_t from its printing + * callback. This violates lock nesting if the caller acquired an always + * spinning lock (raw_spinlock_t) while invoking printk(). This is not a + * problem on PREEMPT_RT because legacy consoles print always from a + * dedicated thread and never from within printk(). Therefore we tell + * lockdep that a sleeping spin lock (spinlock_t) is valid here. */ #ifdef CONFIG_PREEMPT_RT static inline void printk_legacy_allow_spinlock_enter(void) { } static inline void printk_legacy_allow_spinlock_exit(void) { } #else -static DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map, LD_WAIT_SLEEP); +static DEFINE_WAIT_OVERRIDE_MAP(printk_legacy_map, LD_WAIT_CONFIG); static inline void printk_legacy_allow_spinlock_enter(void) { |