Commit 3c31041e authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'printk-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux

Pull printk updates from Petr Mladek:

 - Do not try to get the console lock when it is not need or useful in
   panic()

 - Replace the global console_suspended state by a per-console flag

 - Export symbols needed for dumping the raw printk buffer in panic()

 - Fix documentation of printf formats for integer types

 - Moved Sergey Senozhatsky to the reviewer role

 - Misc cleanups

* tag 'printk-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
  printk: export symbols for debug modules
  lib: test_scanf: Add explicit type cast to result initialization in test_number_prefix()
  printk: ringbuffer: Fix truncating buffer size min_t cast
  printk: Rename abandon_console_lock_in_panic() to other_cpu_in_panic()
  printk: Add per-console suspended state
  printk: Consolidate console deferred printing
  printk: Do not take console lock for console_flush_on_panic()
  printk: Keep non-panic-CPUs out of console lock
  printk: Reduce console_unblank() usage in unsafe scenarios
  kdb: Do not assume write() callback available
  docs: printk-formats: Treat char as always unsigned
  docs: printk-formats: Fix hex printing of signed values
  MAINTAINERS: adjust printk/vsprintf entries
parents 4accdb98 f0f69239
...@@ -15,9 +15,10 @@ Integer types ...@@ -15,9 +15,10 @@ Integer types
If variable is of Type, use printk format specifier: If variable is of Type, use printk format specifier:
------------------------------------------------------------ ------------------------------------------------------------
char %d or %x signed char %d or %hhx
unsigned char %u or %x unsigned char %u or %x
short int %d or %x char %u or %x
short int %d or %hx
unsigned short int %u or %x unsigned short int %u or %x
int %d or %x int %d or %x
unsigned int %u or %x unsigned int %u or %x
...@@ -27,9 +28,9 @@ Integer types ...@@ -27,9 +28,9 @@ Integer types
unsigned long long %llu or %llx unsigned long long %llu or %llx
size_t %zu or %zx size_t %zu or %zx
ssize_t %zd or %zx ssize_t %zd or %zx
s8 %d or %x s8 %d or %hhx
u8 %u or %x u8 %u or %x
s16 %d or %x s16 %d or %hx
u16 %u or %x u16 %u or %x
s32 %d or %x s32 %d or %x
u32 %u or %x u32 %u or %x
......
...@@ -17176,9 +17176,9 @@ F: kernel/sched/psi.c ...@@ -17176,9 +17176,9 @@ F: kernel/sched/psi.c
PRINTK PRINTK
M: Petr Mladek <pmladek@suse.com> M: Petr Mladek <pmladek@suse.com>
M: Sergey Senozhatsky <senozhatsky@chromium.org>
R: Steven Rostedt <rostedt@goodmis.org> R: Steven Rostedt <rostedt@goodmis.org>
R: John Ogness <john.ogness@linutronix.de> R: John Ogness <john.ogness@linutronix.de>
R: Sergey Senozhatsky <senozhatsky@chromium.org>
S: Maintained S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
F: include/linux/printk.h F: include/linux/printk.h
...@@ -23072,9 +23072,9 @@ F: drivers/net/vrf.c ...@@ -23072,9 +23072,9 @@ F: drivers/net/vrf.c
VSPRINTF VSPRINTF
M: Petr Mladek <pmladek@suse.com> M: Petr Mladek <pmladek@suse.com>
M: Steven Rostedt <rostedt@goodmis.org> M: Steven Rostedt <rostedt@goodmis.org>
M: Sergey Senozhatsky <senozhatsky@chromium.org>
R: Andy Shevchenko <andriy.shevchenko@linux.intel.com> R: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
R: Rasmus Villemoes <linux@rasmusvillemoes.dk> R: Rasmus Villemoes <linux@rasmusvillemoes.dk>
R: Sergey Senozhatsky <senozhatsky@chromium.org>
S: Maintained S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux.git
F: Documentation/core-api/printk-formats.rst F: Documentation/core-api/printk-formats.rst
......
...@@ -154,6 +154,8 @@ static inline int con_debug_leave(void) ...@@ -154,6 +154,8 @@ static inline int con_debug_leave(void)
* receiving the printk spam for obvious reasons. * receiving the printk spam for obvious reasons.
* @CON_EXTENDED: The console supports the extended output format of * @CON_EXTENDED: The console supports the extended output format of
* /dev/kmesg which requires a larger output buffer. * /dev/kmesg which requires a larger output buffer.
* @CON_SUSPENDED: Indicates if a console is suspended. If true, the
* printing callbacks must not be called.
*/ */
enum cons_flags { enum cons_flags {
CON_PRINTBUFFER = BIT(0), CON_PRINTBUFFER = BIT(0),
...@@ -163,6 +165,7 @@ enum cons_flags { ...@@ -163,6 +165,7 @@ enum cons_flags {
CON_ANYTIME = BIT(4), CON_ANYTIME = BIT(4),
CON_BRL = BIT(5), CON_BRL = BIT(5),
CON_EXTENDED = BIT(6), CON_EXTENDED = BIT(6),
CON_SUSPENDED = BIT(7),
}; };
/** /**
......
...@@ -590,6 +590,8 @@ static void kdb_msg_write(const char *msg, int msg_len) ...@@ -590,6 +590,8 @@ static void kdb_msg_write(const char *msg, int msg_len)
continue; continue;
if (c == dbg_io_ops->cons) if (c == dbg_io_ops->cons)
continue; continue;
if (!c->write)
continue;
/* /*
* Set oops_in_progress to encourage the console drivers to * Set oops_in_progress to encourage the console drivers to
* disregard their internal spin locks: in the current calling * disregard their internal spin locks: in the current calling
......
...@@ -103,3 +103,5 @@ struct printk_message { ...@@ -103,3 +103,5 @@ struct printk_message {
u64 seq; u64 seq;
unsigned long dropped; unsigned long dropped;
}; };
bool other_cpu_in_panic(void);
This diff is collapsed.
...@@ -1735,7 +1735,7 @@ static bool copy_data(struct prb_data_ring *data_ring, ...@@ -1735,7 +1735,7 @@ static bool copy_data(struct prb_data_ring *data_ring,
if (!buf || !buf_size) if (!buf || !buf_size)
return true; return true;
data_size = min_t(u16, buf_size, len); data_size = min_t(unsigned int, buf_size, len);
memcpy(&buf[0], data, data_size); /* LMM(copy_data:A) */ memcpy(&buf[0], data, data_size); /* LMM(copy_data:A) */
return true; return true;
......
...@@ -38,13 +38,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) ...@@ -38,13 +38,8 @@ asmlinkage int vprintk(const char *fmt, va_list args)
* Use the main logbuf even in NMI. But avoid calling console * Use the main logbuf even in NMI. But avoid calling console
* drivers that might have their own locks. * drivers that might have their own locks.
*/ */
if (this_cpu_read(printk_context) || in_nmi()) { if (this_cpu_read(printk_context) || in_nmi())
int len; return vprintk_deferred(fmt, args);
len = vprintk_store(0, LOGLEVEL_DEFAULT, NULL, fmt, args);
defer_console_output();
return len;
}
/* No obstacles. */ /* No obstacles. */
return vprintk_default(fmt, args); return vprintk_default(fmt, args);
......
...@@ -606,7 +606,7 @@ static void __init numbers_slice(void) ...@@ -606,7 +606,7 @@ static void __init numbers_slice(void)
#define test_number_prefix(T, str, scan_fmt, expect0, expect1, n_args, fn) \ #define test_number_prefix(T, str, scan_fmt, expect0, expect1, n_args, fn) \
do { \ do { \
const T expect[2] = { expect0, expect1 }; \ const T expect[2] = { expect0, expect1 }; \
T result[2] = {~expect[0], ~expect[1]}; \ T result[2] = { (T)~expect[0], (T)~expect[1] }; \
\ \
_test(fn, &expect, str, scan_fmt, n_args, &result[0], &result[1]); \ _test(fn, &expect, str, scan_fmt, n_args, &result[0], &result[1]); \
} while (0) } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment