[PATCH printk v3 01/19] printk: nbcon: Clarify nbcon_get_default_prio() context

From: John Ogness
Date: Mon Jul 22 2024 - 13:19:59 EST


Correct the kerneldoc and code comments that claimed migration must
be disabled for nbcon_get_default_prio(). This is not true.

Add the explation in the kerneldoc.

Signed-off-by: John Ogness <john.ogness@xxxxxxxxxxxxx>
---
kernel/printk/nbcon.c | 5 ++++-
kernel/printk/printk.c | 2 --
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
index ef6e76db0f5a..d8388faa6500 100644
--- a/kernel/printk/nbcon.c
+++ b/kernel/printk/nbcon.c
@@ -970,9 +970,12 @@ static __ref unsigned int *nbcon_get_cpu_emergency_nesting(void)
* nbcon_get_default_prio - The appropriate nbcon priority to use for nbcon
* printing on the current CPU
*
- * Context: Any context which could not be migrated to another CPU.
+ * Context: Any context.
* Return: The nbcon_prio to use for acquiring an nbcon console in this
* context for printing.
+ *
+ * Allowing migration enabled relies on the fact that a context cannot be
+ * migrated to panic or emergency state CPUs.
*/
enum nbcon_prio nbcon_get_default_prio(void)
{
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index d0bff0b0abfd..5090c0591f88 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2401,8 +2401,6 @@ asmlinkage int vprintk_emit(int facility, int level,
* printing of all remaining records to all consoles so that
* this context can return as soon as possible. Hopefully
* another printk() caller will take over the printing.
- *
- * Also, nbcon_get_default_prio() requires migration disabled.
*/
preempt_disable();

--
2.39.2