Re: [PATCH printk v2 1/2] printk/nbcon: Flush nbcon_irq_work in nbcon_free()
From: John Ogness
Date: Mon Aug 31 2026 - 17:37:53 EST
On 2026-08-31, Petr Mladek <pmladek@xxxxxxxx> wrote:
>> diff --git a/kernel/printk/nbcon.c b/kernel/printk/nbcon.c
>> index a5921a84a80ed..218b1922a58de 100644
>> --- a/kernel/printk/nbcon.c
>> +++ b/kernel/printk/nbcon.c
>> @@ -1849,6 +1849,8 @@ void nbcon_free(struct console *con)
>> printk_kthreads_running = false;
>> }
>>
>> + irq_work_sync(&con->irq_work);
>
> The irq_work work tries to wake up the printk kthread which
> has been destroyed above.
Note that the irq_work only wakes up con->rcuwait waiters. Since the
kthread has already ended, it certainly is not waiting and there is no
wakeup.
The irq_work_sync() call is literally just to clear out the irq_work
queue, not to actually wake anything.
John