From 900fb0685f65b3fa5ee7e164483b9db7f80c0ab1 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Thu, 18 Nov 2021 19:36:45 +0100 Subject: [rt] Refresh "printk: introduce kernel sync mode" --- debian/changelog | 1 + .../printk__introduce_kernel_sync_mode.patch | 42 +++++++++++----------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index 085de2262..5457e9f22 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,7 @@ linux (5.15.3-1~exp1) UNRELEASED; urgency=medium [ Salvatore Bonaccorso ] * mac80211: fix radiotap header generation * [rt] Update to 5.15.2-rt20 + * [rt] Refresh "printk: introduce kernel sync mode" -- Vincent Blut Tue, 16 Nov 2021 12:52:31 +0100 diff --git a/debian/patches-rt/printk__introduce_kernel_sync_mode.patch b/debian/patches-rt/printk__introduce_kernel_sync_mode.patch index 77bb9a69b..5727a586b 100644 --- a/debian/patches-rt/printk__introduce_kernel_sync_mode.patch +++ b/debian/patches-rt/printk__introduce_kernel_sync_mode.patch @@ -32,10 +32,10 @@ Signed-off-by: Thomas Gleixner struct vc_data; struct console_font_op; -@@ -150,6 +151,9 @@ struct console { - short flags; - short index; +@@ -152,6 +153,9 @@ int cflag; + uint ispeed; + uint ospeed; +#ifdef CONFIG_PRINTK + char sync_buf[CONSOLE_LOG_MAX]; +#endif @@ -44,7 +44,7 @@ Signed-off-by: Thomas Gleixner }; --- a/include/linux/printk.h +++ b/include/linux/printk.h -@@ -47,6 +47,12 @@ static inline const char *printk_skip_he +@@ -47,6 +47,12 @@ #define CONSOLE_EXT_LOG_MAX 8192 @@ -67,7 +67,7 @@ Signed-off-by: Thomas Gleixner #include #include #include -@@ -355,6 +356,9 @@ static int console_msg_format = MSG_FORM +@@ -355,6 +356,9 @@ static DEFINE_MUTEX(syslog_lock); #ifdef CONFIG_PRINTK @@ -77,7 +77,7 @@ Signed-off-by: Thomas Gleixner DECLARE_WAIT_QUEUE_HEAD(log_wait); /* All 3 protected by @syslog_lock. */ /* the next printk record to read by syslog(READ) or /proc/kmsg */ -@@ -382,6 +386,20 @@ static struct latched_seq console_seq = +@@ -382,6 +386,20 @@ .val[1] = 0, }; @@ -98,7 +98,7 @@ Signed-off-by: Thomas Gleixner /* * The next printk record to read after the last 'clear' command. There are * two copies (updated with seqcount_latch) so that reads can locklessly -@@ -399,9 +417,6 @@ static struct latched_seq clear_seq = { +@@ -399,9 +417,6 @@ #define PREFIX_MAX 32 #endif @@ -108,7 +108,7 @@ Signed-off-by: Thomas Gleixner /* the maximum size allowed to be reserved for a record */ #define LOG_LINE_MAX (CONSOLE_LOG_MAX - PREFIX_MAX) -@@ -1773,6 +1788,116 @@ static inline void printk_delay(int leve +@@ -1773,6 +1788,116 @@ } } @@ -225,7 +225,7 @@ Signed-off-by: Thomas Gleixner /* * Special console_lock variants that help to reduce the risk of soft-lockups. * They allow to pass console_lock to another printk() call using a busy wait. -@@ -1947,6 +2072,8 @@ static void call_console_drivers(const c +@@ -1947,6 +2072,8 @@ if (!cpu_online(smp_processor_id()) && !(con->flags & CON_ANYTIME)) continue; @@ -234,7 +234,7 @@ Signed-off-by: Thomas Gleixner if (con->flags & CON_EXTENDED) con->write(con, ext_text, ext_len); else { -@@ -2114,6 +2241,7 @@ int vprintk_store(int facility, int leve +@@ -2114,6 +2241,7 @@ const u32 caller_id = printk_caller_id(); struct prb_reserved_entry e; enum printk_info_flags flags = 0; @@ -242,7 +242,7 @@ Signed-off-by: Thomas Gleixner struct printk_record r; unsigned long irqflags; u16 trunc_msg_len = 0; -@@ -2124,6 +2252,7 @@ int vprintk_store(int facility, int leve +@@ -2124,6 +2252,7 @@ u16 text_len; int ret = 0; u64 ts_nsec; @@ -250,7 +250,7 @@ Signed-off-by: Thomas Gleixner /* * Since the duration of printk() can vary depending on the message -@@ -2162,6 +2291,7 @@ int vprintk_store(int facility, int leve +@@ -2162,6 +2291,7 @@ if (flags & LOG_CONT) { prb_rec_init_wr(&r, reserve_size); if (prb_reserve_in_last(&e, prb, &r, caller_id, LOG_LINE_MAX)) { @@ -258,7 +258,7 @@ Signed-off-by: Thomas Gleixner text_len = printk_sprint(&r.text_buf[r.info->text_len], reserve_size, facility, &flags, fmt, args); r.info->text_len += text_len; -@@ -2169,6 +2299,7 @@ int vprintk_store(int facility, int leve +@@ -2169,6 +2299,7 @@ if (flags & LOG_NEWLINE) { r.info->flags |= LOG_NEWLINE; prb_final_commit(&e); @@ -266,7 +266,7 @@ Signed-off-by: Thomas Gleixner } else { prb_commit(&e); } -@@ -2192,6 +2323,7 @@ int vprintk_store(int facility, int leve +@@ -2192,6 +2323,7 @@ if (!prb_reserve(&e, prb, &r)) goto out; } @@ -274,7 +274,7 @@ Signed-off-by: Thomas Gleixner /* fill message */ text_len = printk_sprint(&r.text_buf[0], reserve_size, facility, &flags, fmt, args); -@@ -2207,13 +2339,25 @@ int vprintk_store(int facility, int leve +@@ -2207,13 +2339,25 @@ memcpy(&r.info->dev_info, dev_info, sizeof(r.info->dev_info)); /* A message without a trailing newline can be continued. */ @@ -302,7 +302,7 @@ Signed-off-by: Thomas Gleixner printk_exit_irqrestore(recursion_ptr, irqflags); return ret; } -@@ -2282,13 +2426,13 @@ EXPORT_SYMBOL(_printk); +@@ -2282,13 +2426,13 @@ #else /* CONFIG_PRINTK */ @@ -318,7 +318,7 @@ Signed-off-by: Thomas Gleixner static u64 exclusive_console_stop_seq; static unsigned long console_dropped; -@@ -2592,6 +2736,8 @@ static int have_callable_console(void) +@@ -2592,6 +2736,8 @@ */ static inline int can_use_console(void) { @@ -327,7 +327,7 @@ Signed-off-by: Thomas Gleixner return cpu_online(raw_smp_processor_id()) || have_callable_console(); } -@@ -2661,7 +2807,7 @@ void console_unlock(void) +@@ -2661,7 +2807,7 @@ size_t len; skip: @@ -336,7 +336,7 @@ Signed-off-by: Thomas Gleixner if (!prb_read_valid(prb, seq, &r)) break; -@@ -2741,7 +2887,7 @@ void console_unlock(void) +@@ -2741,7 +2887,7 @@ * there's a new owner and the console_unlock() from them will do the * flush, no worries. */ @@ -345,7 +345,7 @@ Signed-off-by: Thomas Gleixner if (retry && console_trylock()) goto again; } -@@ -3041,7 +3187,7 @@ void register_console(struct console *ne +@@ -3041,7 +3187,7 @@ * ignores console_lock. */ exclusive_console = newcon; @@ -354,7 +354,7 @@ Signed-off-by: Thomas Gleixner /* Get a consistent copy of @syslog_seq. */ mutex_lock(&syslog_lock); -@@ -3411,6 +3557,18 @@ void kmsg_dump(enum kmsg_dump_reason rea +@@ -3411,6 +3557,18 @@ { struct kmsg_dumper *dumper; -- cgit v1.2.3