From 62db400e83102695233497884d16a19c7e34fcd4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 19 Jun 2024 23:00:54 +0200 Subject: Merging debian version 6.9.2-1~exp1. Signed-off-by: Daniel Baumann --- ...-Add-flags-argument-for-console_is_usable.patch | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 debian/patches-rt/0016-printk-Add-flags-argument-for-console_is_usable.patch (limited to 'debian/patches-rt/0016-printk-Add-flags-argument-for-console_is_usable.patch') diff --git a/debian/patches-rt/0016-printk-Add-flags-argument-for-console_is_usable.patch b/debian/patches-rt/0016-printk-Add-flags-argument-for-console_is_usable.patch new file mode 100644 index 000000000..86ab3528a --- /dev/null +++ b/debian/patches-rt/0016-printk-Add-flags-argument-for-console_is_usable.patch @@ -0,0 +1,67 @@ +From: John Ogness +Date: Tue, 12 Sep 2023 13:45:33 +0000 +Subject: [PATCH 16/46] printk: Add @flags argument for console_is_usable() +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/6.9/older/patches-6.9-rt5.tar.xz + +The caller of console_is_usable() usually needs @console->flags +for its own checks. Rather than having console_is_usable() read +its own copy, make the caller pass in the @flags. This also +ensures that the caller saw the same @flags value. + +Signed-off-by: John Ogness +Reviewed-by: Petr Mladek +Signed-off-by: Sebastian Andrzej Siewior +--- + kernel/printk/internal.h | 8 ++------ + kernel/printk/printk.c | 5 +++-- + 2 files changed, 5 insertions(+), 8 deletions(-) + +--- a/kernel/printk/internal.h ++++ b/kernel/printk/internal.h +@@ -90,13 +90,9 @@ void nbcon_free(struct console *con); + * records. Note that this function does not consider the current context, + * which can also play a role in deciding if @con can be used to print + * records. +- * +- * Requires the console_srcu_read_lock. + */ +-static inline bool console_is_usable(struct console *con) ++static inline bool console_is_usable(struct console *con, short flags) + { +- short flags = console_srcu_read_flags(con); +- + if (!(flags & CON_ENABLED)) + return false; + +@@ -143,7 +139,7 @@ static inline bool nbcon_alloc(struct co + static inline void nbcon_init(struct console *con, u64 init_seq) { } + static inline void nbcon_free(struct console *con) { } + +-static inline bool console_is_usable(struct console *con) { return false; } ++static inline bool console_is_usable(struct console *con, short flags) { return false; } + + #endif /* CONFIG_PRINTK */ + +--- a/kernel/printk/printk.c ++++ b/kernel/printk/printk.c +@@ -2942,9 +2942,10 @@ static bool console_flush_all(bool do_co + + cookie = console_srcu_read_lock(); + for_each_console_srcu(con) { ++ short flags = console_srcu_read_flags(con); + bool progress; + +- if (!console_is_usable(con)) ++ if (!console_is_usable(con, flags)) + continue; + any_usable = true; + +@@ -3838,7 +3839,7 @@ static bool __pr_flush(struct console *c + * that they make forward progress, so only increment + * @diff for usable consoles. + */ +- if (!console_is_usable(c)) ++ if (!console_is_usable(c, flags)) + continue; + + if (flags & CON_NBCON) { -- cgit v1.2.3