diff options
Diffstat (limited to 'debian/patches-rt/0012-printk-remove-logbuf_lock.patch')
-rw-r--r-- | debian/patches-rt/0012-printk-remove-logbuf_lock.patch | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/debian/patches-rt/0012-printk-remove-logbuf_lock.patch b/debian/patches-rt/0012-printk-remove-logbuf_lock.patch index 7a12de828..4f374b118 100644 --- a/debian/patches-rt/0012-printk-remove-logbuf_lock.patch +++ b/debian/patches-rt/0012-printk-remove-logbuf_lock.patch @@ -1,7 +1,7 @@ From: John Ogness <john.ogness@linutronix.de> Date: Tue, 26 Jan 2021 17:43:19 +0106 Subject: [PATCH 12/28] printk: remove logbuf_lock -Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.17-rt32.tar.xz +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.21-rt34.tar.xz Since the ringbuffer is lockless, there is no need for it to be protected by @logbuf_lock. Remove @logbuf_lock. @@ -31,7 +31,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> __printf(4, 0) int vprintk_store(int facility, int level, const struct dev_printk_info *dev_info, -@@ -59,7 +57,7 @@ +@@ -59,7 +57,7 @@ void defer_console_output(void); __printf(1, 0) int vprintk_func(const char *fmt, va_list args) { return 0; } /* @@ -42,7 +42,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c -@@ -355,41 +355,6 @@ +@@ -355,41 +355,6 @@ enum log_flags { LOG_CONT = 8, /* text is a fragment of a continuation line */ }; @@ -84,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* syslog_lock protects syslog_* variables and write access to clear_seq. */ static DEFINE_RAW_SPINLOCK(syslog_lock); -@@ -401,6 +366,7 @@ +@@ -401,6 +366,7 @@ static u64 syslog_seq; static size_t syslog_partial; static bool syslog_time; @@ -92,7 +92,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* the next printk record to write to the console */ static u64 console_seq; static u64 exclusive_console_stop_seq; -@@ -767,27 +733,27 @@ +@@ -767,27 +733,27 @@ static ssize_t devkmsg_read(struct file if (ret) return ret; @@ -125,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; } -@@ -797,7 +763,7 @@ +@@ -797,7 +763,7 @@ static ssize_t devkmsg_read(struct file &r->info->dev_info); atomic64_set(&user->seq, r->info->seq + 1); @@ -134,7 +134,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (len > count) { ret = -EINVAL; -@@ -832,7 +798,7 @@ +@@ -832,7 +798,7 @@ static loff_t devkmsg_llseek(struct file if (offset) return -ESPIPE; @@ -143,7 +143,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> switch (whence) { case SEEK_SET: /* the first record */ -@@ -853,7 +819,7 @@ +@@ -853,7 +819,7 @@ static loff_t devkmsg_llseek(struct file default: ret = -EINVAL; } @@ -152,7 +152,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -868,15 +834,15 @@ +@@ -868,15 +834,15 @@ static __poll_t devkmsg_poll(struct file poll_wait(file, &log_wait, wait); @@ -171,7 +171,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -909,9 +875,9 @@ +@@ -909,9 +875,9 @@ static int devkmsg_open(struct inode *in prb_rec_init_rd(&user->record, &user->info, &user->text_buf[0], sizeof(user->text_buf)); @@ -183,7 +183,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> file->private_data = user; return 0; -@@ -1533,11 +1499,11 @@ +@@ -1533,11 +1499,11 @@ static int syslog_print(char __user *buf size_t n; size_t skip; @@ -197,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> break; } if (r.info->seq != syslog_seq) { -@@ -1567,7 +1533,7 @@ +@@ -1567,7 +1533,7 @@ static int syslog_print(char __user *buf } else n = 0; raw_spin_unlock(&syslog_lock); @@ -206,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (!n) break; -@@ -1601,7 +1567,7 @@ +@@ -1601,7 +1567,7 @@ static int syslog_print_all(char __user return -ENOMEM; time = printk_time; @@ -215,7 +215,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * Find first record that fits, including all following records, * into the user-provided buffer for this dump. -@@ -1622,12 +1588,12 @@ +@@ -1622,12 +1588,12 @@ static int syslog_print_all(char __user break; } @@ -230,7 +230,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (len < 0) break; -@@ -1638,7 +1604,7 @@ +@@ -1638,7 +1604,7 @@ static int syslog_print_all(char __user latched_seq_write(&clear_seq, seq); raw_spin_unlock(&syslog_lock); } @@ -239,7 +239,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> kfree(text); return len; -@@ -1646,11 +1612,11 @@ +@@ -1646,11 +1612,11 @@ static int syslog_print_all(char __user static void syslog_clear(void) { @@ -253,7 +253,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } /* Return a consistent copy of @syslog_seq. */ -@@ -1738,12 +1704,12 @@ +@@ -1738,12 +1704,12 @@ int do_syslog(int type, char __user *buf break; /* Number of chars in the log buffer */ case SYSLOG_ACTION_SIZE_UNREAD: @@ -268,7 +268,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return 0; } if (info.seq != syslog_seq) { -@@ -1772,7 +1738,7 @@ +@@ -1772,7 +1738,7 @@ int do_syslog(int type, char __user *buf error -= syslog_partial; } raw_spin_unlock(&syslog_lock); @@ -277,7 +277,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> break; /* Size of the log buffer */ case SYSLOG_ACTION_SIZE_BUFFER: -@@ -2621,7 +2587,6 @@ +@@ -2621,7 +2587,6 @@ void console_unlock(void) size_t len; printk_safe_enter_irqsave(flags); @@ -285,7 +285,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> skip: if (!prb_read_valid(prb, console_seq, &r)) break; -@@ -2665,7 +2630,6 @@ +@@ -2665,7 +2630,6 @@ void console_unlock(void) console_msg_format & MSG_FORMAT_SYSLOG, printk_time); console_seq++; @@ -293,7 +293,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * While actively printing out messages, if another printk() -@@ -2692,8 +2656,6 @@ +@@ -2692,8 +2656,6 @@ void console_unlock(void) console_locked = 0; @@ -302,7 +302,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> up_console_sem(); /* -@@ -2702,9 +2664,7 @@ +@@ -2702,9 +2664,7 @@ void console_unlock(void) * there's a new owner and the console_unlock() from them will do the * flush, no worries. */ @@ -312,7 +312,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> printk_safe_exit_irqrestore(flags); if (retry && console_trylock()) -@@ -2771,9 +2731,9 @@ +@@ -2771,9 +2731,9 @@ void console_flush_on_panic(enum con_flu if (mode == CONSOLE_REPLAY_ALL) { unsigned long flags; @@ -324,7 +324,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } console_unlock(); } -@@ -3002,7 +2962,7 @@ +@@ -3002,7 +2962,7 @@ void register_console(struct console *ne * console_unlock(); will print out the buffered messages * for us. */ @@ -333,7 +333,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* * We're about to replay the log buffer. Only do this to the * just-registered console to avoid excessive message spam to -@@ -3020,7 +2980,7 @@ +@@ -3020,7 +2980,7 @@ void register_console(struct console *ne console_seq = syslog_seq; raw_spin_unlock(&syslog_lock); @@ -342,7 +342,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> } console_unlock(); console_sysfs_notify(); -@@ -3406,10 +3366,10 @@ +@@ -3406,10 +3366,10 @@ void kmsg_dump(enum kmsg_dump_reason rea /* initialize iterator with data about the stored records */ iter.active = true; @@ -355,7 +355,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> /* invoke dumper which will iterate over records */ dumper->dump(dumper, reason, &iter); -@@ -3496,9 +3456,9 @@ +@@ -3496,9 +3456,9 @@ bool kmsg_dump_get_line(struct kmsg_dump unsigned long flags; bool ret; @@ -367,7 +367,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> return ret; } -@@ -3538,7 +3498,7 @@ +@@ -3538,7 +3498,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du if (!iter->active || !buf || !size) goto out; @@ -376,7 +376,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (prb_read_valid_info(prb, iter->cur_seq, &info, NULL)) { if (info.seq != iter->cur_seq) { /* messages are gone, move to first available one */ -@@ -3548,7 +3508,7 @@ +@@ -3548,7 +3508,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du /* last entry */ if (iter->cur_seq >= iter->next_seq) { @@ -385,7 +385,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> goto out; } -@@ -3582,7 +3542,7 @@ +@@ -3582,7 +3542,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du iter->next_seq = next_seq; ret = true; @@ -394,7 +394,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> out: if (len_out) *len_out = len; -@@ -3618,9 +3578,9 @@ +@@ -3618,9 +3578,9 @@ void kmsg_dump_rewind(struct kmsg_dumper { unsigned long flags; @@ -417,7 +417,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> * it uses an alternative implementation that temporary stores * the strings into a per-CPU buffer. The content of the buffer * is later flushed into the main ring buffer via IRQ work. -@@ -266,18 +266,6 @@ +@@ -266,18 +266,6 @@ void printk_safe_flush(void) */ void printk_safe_flush_on_panic(void) { @@ -436,7 +436,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> if (raw_spin_is_locked(&safe_read_lock)) { if (num_online_cpus() > 1) return; -@@ -319,9 +307,7 @@ +@@ -319,9 +307,7 @@ void noinstr printk_nmi_exit(void) * reordering. * * It has effect only when called in NMI context. Then printk() @@ -447,7 +447,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> */ void printk_nmi_direct_enter(void) { -@@ -376,20 +362,21 @@ +@@ -376,20 +362,21 @@ void __printk_safe_exit(void) #endif /* |