<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/console.h, branch v6.19.11</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.19.11'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-12-03T20:42:36+00:00</updated>
<entry>
<title>Merge tag 'printk-for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux</title>
<updated>2025-12-03T20:42:36+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2025-12-03T20:42:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d38b88fd17e9989429e65420bf3c33ca53b2085'/>
<id>urn:sha1:4d38b88fd17e9989429e65420bf3c33ca53b2085</id>
<content type='text'>
Pull printk updates from Petr Mladek:

 - Allow creaing nbcon console drivers with an unsafe write_atomic()
   callback that can only be called by the final nbcon_atomic_flush_unsafe().
   Otherwise, the driver would rely on the kthread.

   It is going to be used as the-best-effort approach for an
   experimental nbcon netconsole driver, see

     https://lore.kernel.org/r/20251121-nbcon-v1-2-503d17b2b4af@debian.org

   Note that a safe .write_atomic() callback is supposed to work in NMI
   context. But some networking drivers are not safe even in IRQ
   context:

     https://lore.kernel.org/r/oc46gdpmmlly5o44obvmoatfqo5bhpgv7pabpvb6sjuqioymcg@gjsma3ghoz35

   In an ideal world, all networking drivers would be fixed first and
   the atomic flush would be blocked only in NMI context. But it brings
   the question how reliable networking drivers are when the system is
   in a bad state. They might block flushing more reliable serial
   consoles which are more suitable for serious debugging anyway.

 - Allow to use the last 4 bytes of the printk ring buffer.

 - Prevent queuing IRQ work and block printk kthreads when consoles are
   suspended. Otherwise, they create non-necessary churn or even block
   the suspend.

 - Release console_lock() between each record in the kthread used for
   legacy consoles on RT. It might significantly speed up the boot.

 - Release nbcon context between each record in the atomic flush. It
   prevents stalls of the related printk kthread after it has lost the
   ownership in the middle of a record

 - Add support for NBCON consoles into KDB

 - Add %ptsP modifier for printing struct timespec64 and use it where
   possible

 - Misc code clean up

* tag 'printk-for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: (48 commits)
  printk: Use console_is_usable on console_unblank
  arch: um: kmsg_dump: Use console_is_usable
  drivers: serial: kgdboc: Drop checks for CON_ENABLED and CON_BOOT
  lib/vsprintf: Unify FORMAT_STATE_NUM handlers
  printk: Avoid irq_work for printk_deferred() on suspend
  printk: Avoid scheduling irq_work on suspend
  printk: Allow printk_trigger_flush() to flush all types
  tracing: Switch to use %ptSp
  scsi: snic: Switch to use %ptSp
  scsi: fnic: Switch to use %ptSp
  s390/dasd: Switch to use %ptSp
  ptp: ocp: Switch to use %ptSp
  pps: Switch to use %ptSp
  PCI: epf-test: Switch to use %ptSp
  net: dsa: sja1105: Switch to use %ptSp
  mmc: mmc_test: Switch to use %ptSp
  media: av7110: Switch to use %ptSp
  ipmi: Switch to use %ptSp
  igb: Switch to use %ptSp
  e1000e: Switch to use %ptSp
  ...
</content>
</entry>
<entry>
<title>printk: nbcon: Allow unsafe write_atomic() for panic</title>
<updated>2025-11-07T13:30:52+00:00</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2025-10-27T16:12:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=187de7c212e5fa87779e1026bf949337bca0cdaa'/>
<id>urn:sha1:187de7c212e5fa87779e1026bf949337bca0cdaa</id>
<content type='text'>
There may be console drivers that have not yet figured out a way
to implement safe atomic printing (-&gt;write_atomic() callback).
These drivers could choose to only implement threaded printing
(-&gt;write_thread() callback), but then it is guaranteed that _no_
output will be printed during panic. Not even attempted.

As a result, developers may be tempted to implement unsafe
-&gt;write_atomic() callbacks and/or implement some sort of custom
deferred printing trickery to try to make it work. This goes
against the principle intention of the nbcon API as well as
endangers other nbcon drivers that are doing things correctly
(safely).

As a compromise, allow nbcon drivers to implement unsafe
-&gt;write_atomic() callbacks by providing a new console flag
CON_NBCON_ATOMIC_UNSAFE. When specified, the -&gt;write_atomic()
callback for that console will _only_ be called during the
final "hope and pray" flush attempt at the end of a panic:
nbcon_atomic_flush_unsafe().

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Link: https://lore.kernel.org/lkml/b2qps3uywhmjaym4mht2wpxul4yqtuuayeoq4iv4k3zf5wdgh3@tocu6c7mj4lt
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/all/swdpckuwwlv3uiessmtnf2jwlx3jusw6u7fpk5iggqo4t2vdws@7rpjso4gr7qp/ [1]
Link: https://lore.kernel.org/all/20251103-fix_netpoll_aa-v4-1-4cfecdf6da7c@debian.org/ [2]
Link: https://patch.msgid.link/20251027161212.334219-2-john.ogness@linutronix.de
[pmladek@suse.com: Fix build with rework/nbcon-in-kdb branch.]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>kdb: Adapt kdb_msg_write to work with NBCON consoles</title>
<updated>2025-10-24T10:56:20+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-10-16T14:47:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=62627bf0cadf6eae87d92fecf604c42160fe16ef'/>
<id>urn:sha1:62627bf0cadf6eae87d92fecf604c42160fe16ef</id>
<content type='text'>
Function kdb_msg_write was calling con-&gt;write for any found console,
but it won't work on NBCON consoles. In this case we should acquire the
ownership of the console using NBCON_PRIO_EMERGENCY, since printing
kdb messages should only be interrupted by a panic.

At this point, the console is required to use the atomic callback. The
console is skipped if the write_atomic callback is not set or if the
context could not be acquired. The validation of NBCON is done by the
console_is_usable helper. The context is released right after
write_atomic finishes.

The oops_in_progress handling is only needed in the legacy consoles,
so it was moved around the con-&gt;write callback.

Suggested-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Link: https://patch.msgid.link/20251016-nbcon-kgdboc-v6-5-866aac60a80e@suse.com
[pmladek@suse.com: Fixed compilation with !CONFIG_PRINTK.]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>printk: nbcon: Export nbcon_write_context_set_buf</title>
<updated>2025-10-24T10:56:19+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-10-16T14:47:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4349cf0df34f37d2470d246bc9be8d9836dfa49e'/>
<id>urn:sha1:4349cf0df34f37d2470d246bc9be8d9836dfa49e</id>
<content type='text'>
This function will be used in the next patch to allow a driver to set
both the message and message length of a nbcon_write_context. This is
necessary because the function also initializes the -&gt;unsafe_takeover
struct member. By using this helper we ensure that the struct is
initialized correctly.

Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Link: https://patch.msgid.link/20251016-nbcon-kgdboc-v6-4-866aac60a80e@suse.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>printk: nbcon: Introduce KDB helpers</title>
<updated>2025-10-24T10:19:23+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-10-16T14:47:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=49f7d3054e84617395a37a058251c81320a3614a'/>
<id>urn:sha1:49f7d3054e84617395a37a058251c81320a3614a</id>
<content type='text'>
These helpers will be used when calling console-&gt;write_atomic on
KDB code in the next patch. It's basically the same implementation
as nbcon_device_try_acquire, but using NBCON_PRIO_EMERGENCY when
acquiring the context.

If the acquire succeeds, the message and message length are assigned to
nbcon_write_context so -&gt;write_atomic can print the message.

After release try to flush the console since there may be a backlog of
messages in the ringbuffer. The kthread console printers do not get a
chance to run while kdb is active.

Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Link: https://patch.msgid.link/20251016-nbcon-kgdboc-v6-2-866aac60a80e@suse.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>printk: nbcon: Export console_is_usable</title>
<updated>2025-10-24T10:19:23+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-10-16T14:47:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4da42aaa82d6e3fa2e822e6e771d031c2e20a6c7'/>
<id>urn:sha1:4da42aaa82d6e3fa2e822e6e771d031c2e20a6c7</id>
<content type='text'>
The helper will be used on KDB code in the next commits.

Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Link: https://patch.msgid.link/20251016-nbcon-kgdboc-v6-1-866aac60a80e@suse.com
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>console: introduce console_lock guard()s</title>
<updated>2025-08-17T10:46:25+00:00</updated>
<author>
<name>Jiri Slaby (SUSE)</name>
<email>jirislaby@kernel.org</email>
</author>
<published>2025-08-14T07:24:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4847d1187402a5027d9a04393f12d52a5a1d7f98'/>
<id>urn:sha1:4847d1187402a5027d9a04393f12d52a5a1d7f98</id>
<content type='text'>
Having this, guards like these work:
  guard(console_lock)();
or
  scoped_guard(console_lock) {
    ...
  }

See e.g. "vc_screen: use guard()s" later in this series.

Signed-off-by: "Jiri Slaby (SUSE)" &lt;jirislaby@kernel.org&gt;
Link: https://lore.kernel.org/r/20250814072456.182853-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>printk: Rename console_start to console_resume</title>
<updated>2025-03-11T11:51:21+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-02-26T19:59:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5395e09c803e20ea0713eaa3a44bc8dd36a009b7'/>
<id>urn:sha1:5395e09c803e20ea0713eaa3a44bc8dd36a009b7</id>
<content type='text'>
The intent of console_start was to resume a previously suspended console,
so rename it accordingly.

Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-4-0b878577f2e6@suse.com
[pmladek@suse.com: Fixed typo in the commit message. Updated also new drm_log.c.]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>printk: Rename console_stop to console_suspend</title>
<updated>2025-03-11T11:41:55+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-02-26T19:59:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=242fafe3faa761ccc27dc2ebb978ca1ec04adc25'/>
<id>urn:sha1:242fafe3faa761ccc27dc2ebb978ca1ec04adc25</id>
<content type='text'>
The intent of console_stop was in fact to suspend it, so rename the
function accordingly.

Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-3-0b878577f2e6@suse.com
[pmladek@suse.com: Fixed typo in the commit message. Updated also new drm_log.c]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
<entry>
<title>printk: Rename resume_console to console_resume_all</title>
<updated>2025-03-11T10:51:27+00:00</updated>
<author>
<name>Marcos Paulo de Souza</name>
<email>mpdesouza@suse.com</email>
</author>
<published>2025-02-26T19:59:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=63830aef74188354806ea3c9043dd3929c6e47f3'/>
<id>urn:sha1:63830aef74188354806ea3c9043dd3929c6e47f3</id>
<content type='text'>
The function resume_console has a misleading name,  since it resumes all
consoles, so rename it accordingly.

Signed-off-by: Marcos Paulo de Souza &lt;mpdesouza@suse.com&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Reviewed-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Link: https://lore.kernel.org/r/20250226-printk-renaming-v1-2-0b878577f2e6@suse.com
[pmladek@suse.com: Fixed typo in the commit message.]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
</content>
</entry>
</feed>
