]> Gentwo Git Trees - linux/.git/commit
console: Improve console_srcu_read_flags() comments
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 20 Aug 2024 06:29:38 +0000 (08:35 +0206)
committerPetr Mladek <pmladek@suse.com>
Wed, 21 Aug 2024 12:56:23 +0000 (14:56 +0200)
commitdc219d8d858d95549543aa7a41b6e64a0da9e406
tree25683bbd0533abc6d7a2e21895dc292b25795401
parenteabd4600dafacf9895184259373f2445ff748654
console: Improve console_srcu_read_flags() comments

It was not clear when exactly console_srcu_read_flags() must be
used vs. directly reading @console->flags.

Refactor and clarify that console_srcu_read_flags() is only
needed if the console is registered or the caller is in a
context where the registration status of the console may change
(due to another context).

The function requires the caller holds @console_srcu, which will
ensure that the caller sees an appropriate @flags value for the
registered console and that exit/cleanup routines will not run
if the console is in the process of unregistration.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240820063001.36405-13-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
include/linux/console.h