diff options
Diffstat (limited to '')
-rw-r--r-- | debian/patches-rt/0022-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch (renamed from debian/patches-rt/0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch) | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/debian/patches-rt/0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch b/debian/patches-rt/0022-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch index 8156ae1d14..1cfd27dd5d 100644 --- a/debian/patches-rt/0025-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch +++ b/debian/patches-rt/0022-printk-Avoid-console_lock-dance-if-no-legacy-or-boot.patch @@ -1,8 +1,8 @@ From: John Ogness <john.ogness@linutronix.de> Date: Tue, 26 Sep 2023 12:44:07 +0000 -Subject: [PATCH 25/48] printk: Avoid console_lock dance if no legacy or boot +Subject: [PATCH 22/46] printk: Avoid console_lock dance if no legacy or boot consoles -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.8/older/patches-6.8.2-rt11.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.9/older/patches-6.9-rt5.tar.xz Currently the console lock is used to attempt legacy-type printing even if there are no legacy or boot consoles registered. @@ -15,10 +15,11 @@ do not use the console lock if there are no boot consoles and no legacy consoles. Signed-off-by: John Ogness <john.ogness@linutronix.de> +Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> --- - kernel/printk/printk.c | 79 +++++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 64 insertions(+), 15 deletions(-) + kernel/printk/printk.c | 78 +++++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 63 insertions(+), 15 deletions(-) --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -51,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> #ifdef CONFIG_PRINTK DECLARE_WAIT_QUEUE_HEAD(log_wait); /* All 3 protected by @syslog_lock. */ -@@ -2344,7 +2359,7 @@ asmlinkage int vprintk_emit(int facility +@@ -2339,7 +2354,7 @@ asmlinkage int vprintk_emit(int facility printed_len = vprintk_store(facility, level, dev_info, fmt, args); /* If called from the scheduler, we can not call up(). */ @@ -60,7 +61,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * The caller may be holding system-critical or * timing-sensitive locks. Disable preemption during -@@ -2653,7 +2668,7 @@ void resume_console(void) +@@ -2648,7 +2663,7 @@ void resume_console(void) */ static int console_cpu_notify(unsigned int cpu) { @@ -69,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* If trylock fails, someone else is doing the printing */ if (console_trylock()) console_unlock(); -@@ -3194,7 +3209,8 @@ void console_flush_on_panic(enum con_flu +@@ -3189,7 +3204,8 @@ void console_flush_on_panic(enum con_flu nbcon_atomic_flush_pending(); @@ -79,24 +80,23 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* -@@ -3531,6 +3547,8 @@ void register_console(struct console *ne - */ - nbcon_seq_force(newcon, newcon->seq); - newcon->seq = 0; -+ } else { +@@ -3538,6 +3554,7 @@ void register_console(struct console *ne + if (newcon->flags & CON_NBCON) { + nbcon_init(newcon, init_seq); + } else { + have_legacy_console = true; + newcon->seq = init_seq; } - if (newcon->flags & CON_BOOT) -@@ -3605,6 +3623,7 @@ EXPORT_SYMBOL(register_console); +@@ -3613,6 +3630,7 @@ EXPORT_SYMBOL(register_console); /* Must be called under console_list_lock(). */ static int unregister_console_locked(struct console *console) { + bool found_legacy_con = false; bool found_boot_con = false; + unsigned long flags; struct console *c; - int res; -@@ -3661,9 +3680,13 @@ static int unregister_console_locked(str +@@ -3680,9 +3698,13 @@ static int unregister_console_locked(str for_each_console(c) { if (c->flags & CON_BOOT) found_boot_con = true; @@ -110,7 +110,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return res; } -@@ -3824,22 +3847,34 @@ static bool __pr_flush(struct console *c +@@ -3843,22 +3865,34 @@ static bool __pr_flush(struct console *c seq = prb_next_reserve_seq(prb); /* Flush the consoles so that records up to @seq are printed. */ @@ -154,7 +154,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> cookie = console_srcu_read_lock(); for_each_console_srcu(c) { -@@ -3859,6 +3894,7 @@ static bool __pr_flush(struct console *c +@@ -3878,6 +3912,7 @@ static bool __pr_flush(struct console *c if (flags & CON_NBCON) { printk_seq = nbcon_seq_read(c); } else { @@ -162,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> printk_seq = c->seq; } -@@ -3870,7 +3906,8 @@ static bool __pr_flush(struct console *c +@@ -3889,7 +3924,8 @@ static bool __pr_flush(struct console *c if (diff != last_diff && reset_on_progress) remaining_jiffies = timeout_jiffies; @@ -172,7 +172,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* Note: @diff is 0 if there are no usable consoles. */ if (diff == 0 || remaining_jiffies == 0) -@@ -3940,6 +3977,7 @@ static void __wake_up_klogd(int val) +@@ -3959,6 +3995,7 @@ static void __wake_up_klogd(int val) return; preempt_disable(); @@ -180,7 +180,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Guarantee any new records can be seen by tasks preparing to wait * before this context checks if the wait queue is empty. -@@ -3951,11 +3989,22 @@ static void __wake_up_klogd(int val) +@@ -3970,11 +4007,22 @@ static void __wake_up_klogd(int val) * * This pairs with devkmsg_read:A and syslog_print:A. */ |