printk fixes for 7.3-rc3

-----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEESH4wyp42V4tXvYsjUqAMR0iAlPIFAmqhEMMbFIAAAAAABAAO
 bWFudTIsMi41KzEuMTIsMiwyAAoJEFKgDEdIgJTyjjcQAI2HtdUFDsG4GifU1B1s
 ha1uQM9gTH+BPO0RiQwvPD8hg/WdmQ1I60JE3jmWuC+AiT0W/fpHiKvvS5ThW9X7
 gessJNbKnvPW8LYoBCT3gsHO6yOL3pvsgM5fUB+SIn8i/B1TIgf/SqmejXZA0S1b
 3NdU6h/2AhEbpzgp3dPfoQe4zrAIQ2IHrjYJ1JunPTtvNsboc1jML4/ViXOTsIvO
 S7/wsiWD42PfVJI8eXVt5fYR33ruhBqJeMRre2sSZ11NwnValOwmJIxU/RmMlA0S
 Vd1pNE1RMcfodYw9JXrouHo9osx3/lAiKF5J0+xehllE7mn3M8PcCPKGpXuHuKy4
 s1KNXXlP0aQatsyyqYBROZeUOv2roXazY/mHqtQ+zrCrE02Hsn7WGPcSXoIbROj6
 AJIjMpz5caS+twtpa4FwhCckbthoIjPMUsv1a5pm9RU10Gr2PqFnRgDxpUDyi5ve
 2M1ybFeJD89tE+CHtGWVuWUS6e17OG4ydFT0GdfDej0Zlq2PckOoEROenbGFl/wk
 kuN7q40Tmg5DKHcSWvy40aoLNJ2kVyvmbc4I7uOkDRAIjCRAoRyyrLAndABIhb58
 oQwFNaNI09qbrk9o7ol4RSruLrgzA/yzUbflzUeXs57LAAOgGXaZmiKzSabTyuCr
 0O6dIPCCjtEH2YY0Hk6HaLX0
 =zZPb
 -----END PGP SIGNATURE-----

Merge tag 'printk-for-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux

Pull printk fixes from Petr Mladek:

 - Use lazy irq_work for waking printk kthreads

 - Flush pending irq_work before destroying printk kthreads

 - Remove redundant WARN() when a printk kthread can't be created

 - Typo fix

* tag 'printk-for-7.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux:
  printk/nbcon: Change nbcon_irq_work to IRQ_WORK_LAZY
  printk/nbcon: Flush nbcon_irq_work in nbcon_free()
  console: fix /dev/kmsg reference in flags kernel doc
  printk: Don't WARN on kthread_run failure.
This commit is contained in:
Linus Torvalds 2026-09-09 07:06:18 -07:00
commit 3f8b8c94a7
3 changed files with 6 additions and 4 deletions

View File

@ -173,7 +173,7 @@ static inline void con_debug_leave(void) { }
* @CON_BRL: Indicates a braille device which is exempt from
* receiving the printk spam for obvious reasons.
* @CON_EXTENDED: The console supports the extended output format of
* /dev/kmesg which requires a larger output buffer.
* /dev/kmsg which requires a larger output buffer.
* @CON_SUSPENDED: Indicates if a console is suspended. If true, the
* printing callbacks must not be called.
* @CON_NBCON: Console can operate outside of the legacy style console_lock

View File

@ -1382,7 +1382,7 @@ bool nbcon_kthread_create(struct console *con)
return true;
kt = kthread_run(nbcon_kthread_func, con, "pr/%s%d", con->name, con->index);
if (WARN_ON(IS_ERR(kt))) {
if (IS_ERR(kt)) {
con_printk(KERN_ERR, con, "failed to start printing thread\n");
return false;
}
@ -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);
@ -1837,6 +1837,8 @@ void nbcon_free(struct console *con)
/* Synchronize the kthread stop. */
lockdep_assert_console_list_lock_held();
irq_work_sync(&con->irq_work);
if (printk_kthreads_running) {
nbcon_kthread_stop(con);

View File

@ -3732,7 +3732,7 @@ static bool legacy_kthread_create(void)
lockdep_assert_console_list_lock_held();
kt = kthread_run(legacy_kthread_func, NULL, "pr/legacy");
if (WARN_ON(IS_ERR(kt))) {
if (IS_ERR(kt)) {
pr_err("failed to start legacy printing thread\n");
return false;
}