Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

printk: nbcon: Check for device_{lock,unlock} callbacks

These callbacks are necessary to synchronize ->write_thread callback
against other operations using the same device.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Link: https://patch.msgid.link/20251208-nbcon-device-cb-fix-v2-1-36be8d195123@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>

authored by

Marcos Paulo de Souza and committed by
Petr Mladek
bdfcca65 4d38b88f

+5 -2
+5 -2
kernel/printk/nbcon.c
··· 1760 1760 /* Synchronize the kthread start. */ 1761 1761 lockdep_assert_console_list_lock_held(); 1762 1762 1763 - /* The write_thread() callback is mandatory. */ 1764 - if (WARN_ON(!con->write_thread)) 1763 + /* Check for mandatory nbcon callbacks. */ 1764 + if (WARN_ON(!con->write_thread || 1765 + !con->device_lock || 1766 + !con->device_unlock)) { 1765 1767 return false; 1768 + } 1766 1769 1767 1770 rcuwait_init(&con->rcuwait); 1768 1771 init_irq_work(&con->irq_work, nbcon_irq_work);