<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/kernel/printk, branch v6.2-rc8</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.2-rc8</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.2-rc8'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-01-19T13:56:38Z</updated>
<entry>
<title>Merge branch 'rework/console-list-lock' into for-linus</title>
<updated>2023-01-19T13:56:38Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2023-01-19T13:56:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=21493c6e96e550509ead696ecca9f0d7196ee91c'/>
<id>urn:sha1:21493c6e96e550509ead696ecca9f0d7196ee91c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kernel/printk/printk.c: Fix W=1 kernel-doc warning</title>
<updated>2023-01-16T15:59:17Z</updated>
<author>
<name>Anuradha Weeraman</name>
<email>anuradha@debian.org</email>
</author>
<published>2023-01-16T12:56:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4fe59a130c112460626a6a8b9232aa580d9b8efc'/>
<id>urn:sha1:4fe59a130c112460626a6a8b9232aa580d9b8efc</id>
<content type='text'>
Fix W=1 kernel-doc warning:

kernel/printk/printk.c:
 - Include function parameter in console_lock_spinning_disable_and_check()

Signed-off-by: Anuradha Weeraman &lt;anuradha@debian.org&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20230116125635.374567-1-anuradha@debian.org
</content>
</entry>
<entry>
<title>tty: serial: kgdboc: fix mutex locking order for configure_kgdboc()</title>
<updated>2023-01-16T15:44:53Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2023-01-12T16:12:13Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3ef5abd9b5c738bc6fa9a65e40331ef2cb03ad9c'/>
<id>urn:sha1:3ef5abd9b5c738bc6fa9a65e40331ef2cb03ad9c</id>
<content type='text'>
Several mutexes are taken while setting up console serial ports. In
particular, the tty_port-&gt;mutex and @console_mutex are taken:

  serial_pnp_probe
    serial8250_register_8250_port
      uart_add_one_port (locks tty_port-&gt;mutex)
        uart_configure_port
          register_console (locks @console_mutex)

In order to synchronize kgdb's tty_find_polling_driver() with
register_console(), commit 6193bc90849a ("tty: serial: kgdboc:
synchronize tty_find_polling_driver() and register_console()") takes
the @console_mutex. However, this leads to the following call chain
(with locking):

  platform_probe
    kgdboc_probe
      configure_kgdboc (locks @console_mutex)
        tty_find_polling_driver
          uart_poll_init (locks tty_port-&gt;mutex)
            uart_set_options

This is clearly deadlock potential due to the reverse lock ordering.

Since uart_set_options() requires holding @console_mutex in order to
serialize early initialization of the serial-console lock, take the
@console_mutex in uart_poll_init() instead of configure_kgdboc().

Since configure_kgdboc() was using @console_mutex for safe traversal
of the console list, change it to use the SRCU iterator instead.

Add comments to uart_set_options() kerneldoc mentioning that it
requires holding @console_mutex (aka the console_list_lock).

Fixes: 6193bc90849a ("tty: serial: kgdboc: synchronize tty_find_polling_driver() and register_console()")
Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Sergey Senozhatsky &lt;senozhatsky@chromium.org&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
[pmladek@suse.com: Export console_srcu_read_lock_is_held() to fix build kgdboc as a module.]
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20230112161213.1434854-1-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>Merge branch 'rework/console-list-lock' into for-linus</title>
<updated>2022-12-08T10:46:56Z</updated>
<author>
<name>Petr Mladek</name>
<email>pmladek@suse.com</email>
</author>
<published>2022-12-08T10:46:56Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6b2b0d839acaa84f05a77184370f793752e786e9'/>
<id>urn:sha1:6b2b0d839acaa84f05a77184370f793752e786e9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>printk: htmldocs: add missing description</title>
<updated>2022-12-02T10:25:02Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2022-11-22T08:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5074ffbec67ac592614901771d3a15e1198d759d'/>
<id>urn:sha1:5074ffbec67ac592614901771d3a15e1198d759d</id>
<content type='text'>
Variable and return descriptions were missing from the SRCU read
lock functions. Add them.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/87zgcjpdvo.fsf@jogness.linutronix.de
</content>
</entry>
<entry>
<title>printk: relieve console_lock of list synchronization duties</title>
<updated>2022-12-02T10:25:02Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2022-11-16T16:21:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=848a9c106625b10fa74022ea853845a2b7a834f0'/>
<id>urn:sha1:848a9c106625b10fa74022ea853845a2b7a834f0</id>
<content type='text'>
The console_list_lock provides synchronization for console list and
console-&gt;flags updates. All call sites that were using the console_lock
for this synchronization have either switched to use the
console_list_lock or the SRCU list iterator.

Remove console_lock usage for console list updates and console-&gt;flags
updates.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20221116162152.193147-40-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>printk, xen: fbfront: create/use safe function for forcing preferred</title>
<updated>2022-12-02T10:25:02Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2022-11-16T16:21:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6f8836756f3cbb02bfd1f0e033516585250318a9'/>
<id>urn:sha1:6f8836756f3cbb02bfd1f0e033516585250318a9</id>
<content type='text'>
With commit 9e124fe16ff2("xen: Enable console tty by default in domU
if it's not a dummy") a hack was implemented to make sure that the
tty console remains the console behind the /dev/console device. The
main problem with the hack is that, after getting the console pointer
to the tty console, it is assumed the pointer is still valid after
releasing the console_sem. This assumption is incorrect and unsafe.

Make the hack safe by introducing a new function
console_force_preferred_locked() and perform the full operation
under the console_list_lock.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20221116162152.193147-33-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>console: introduce console_is_registered()</title>
<updated>2022-12-02T10:25:01Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2022-11-16T16:21:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1fd4224a6b641f1949e27bf350b5b1c1e47e2ccc'/>
<id>urn:sha1:1fd4224a6b641f1949e27bf350b5b1c1e47e2ccc</id>
<content type='text'>
Currently it is not possible for drivers to detect if they have
already successfully registered their console. Several drivers
have multiple paths that lead to console registration. To avoid
attempting a 2nd registration (which leads to a WARN), drivers
are implementing their own solution.

Introduce console_is_registered() so drivers can easily identify
if their console is currently registered. A _locked() variant
is also provided if the caller is already holding the
console_list_lock.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20221116162152.193147-22-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>printk: console_device: use srcu console list iterator</title>
<updated>2022-12-02T10:25:01Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2022-11-16T16:21:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8cb15f7f492f85d695a6f4d12044c47230f69d96'/>
<id>urn:sha1:8cb15f7f492f85d695a6f4d12044c47230f69d96</id>
<content type='text'>
Use srcu console list iteration for console list traversal. It is
acceptable because the consoles might come and go at any time.
Strict synchronizing with console registration code would not bring
any advantage over srcu.

Document why the console_lock is still necessary. Note that this
is a preparatory change for when console_lock no longer provides
synchronization for the console list.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20221116162152.193147-21-john.ogness@linutronix.de
</content>
</entry>
<entry>
<title>printk: console_flush_on_panic: use srcu console list iterator</title>
<updated>2022-12-02T10:25:01Z</updated>
<author>
<name>John Ogness</name>
<email>john.ogness@linutronix.de</email>
</author>
<published>2022-11-16T16:21:31Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=87f2e4b7d9e5c50756184b4f8d0b92680de61496'/>
<id>urn:sha1:87f2e4b7d9e5c50756184b4f8d0b92680de61496</id>
<content type='text'>
With SRCU it is now safe to traverse the console list, even if
the console_trylock() failed. However, overwriting console-&gt;seq
when console_trylock() failed is still an issue.

Switch to SRCU iteration and document remaining issue with
console-&gt;seq.

Signed-off-by: John Ogness &lt;john.ogness@linutronix.de&gt;
Reviewed-by: Petr Mladek &lt;pmladek@suse.com&gt;
Signed-off-by: Petr Mladek &lt;pmladek@suse.com&gt;
Link: https://lore.kernel.org/r/20221116162152.193147-20-john.ogness@linutronix.de
</content>
</entry>
</feed>
