Re: [PATCH tty v11 1/2] serial: 8250: Switch to nbcon console, take 2

John Ogness <[email protected]>
Newsgroups gmane.linux.ports.tegra,gmane.linux.kernel,gmane.linux.serial
Message-ID <[email protected]>
Hi Jon,

On 2026-08-27, Jon Hunter <[email protected]> wrote:
>> diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
>> index a5921a84a80ed..ad79e30afd647 100644
>> --- a/kernel/printk/nbcon.c
>> +++ b/kernel/printk/nbcon.c
>> @@ -1782,7 +1782,7 @@ bool nbcon_alloc(struct console *con)
>>   	}
>>   
>>   	rcuwait_init(&con->rcuwait);
>> -	init_irq_work(&con->irq_work, nbcon_irq_work);
>> +	con->irq_work = IRQ_WORK_INIT_LAZY(nbcon_irq_work);
>>   	atomic_long_set(&ACCESS_PRIVATE(con, nbcon_prev_seq), -1UL);
>>   	nbcon_state_set(con, &state);
>>   
>
> I gave this a quick try on Tegra20 and Tegra30 and I can confirm that
> this does work.

OK, great. I will prepare an official patch for mainline to change
nbcon_irq_work to LAZY.

Back with v5 you reported [0] similar issues due to suspend/resume. For
that we implemented the @console_irqwork_blocked workaround. We probably
do not need that anymore. You could verify that with the following hack
(and booting with no_console_suspend). Note that you also need the LAZY
change above.

===== BEGIN SUSPEND HACK =====
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 6d3d18a50da74..73c85f6de2c9e 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2796,7 +2796,6 @@ void console_suspend_all(void)
 	 * any klogd waiters are not triggered.
 	 */
 	pr_flush(1000, true);
-	console_irqwork_blocked = true;
 
 	if (!console_suspend_enabled)
 		return;
===== END SUSPEND HACK =====

However, this workaround did allow the consoles to switch to atomic mode
on suspend when no_console_suspend is specified at boot. So the
workaround might be interesting for that reason alone. But we should no
longer need it for the reasons mentioned in commit 26873e3e7f0c
("printk: Avoid scheduling irq_work on suspend")

John

[0] https://lore.kernel.org/lkml/80b020fc-c18a-4da4-b222-16da1cab2f4c-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.