summaryrefslogtreecommitdiff
path: root/kernel/printk
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-03-26 09:25:57 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-03-26 09:25:57 -0700
commit7033999ecd7b8cf9ea59265035a0150961e023ee (patch)
tree739419451657ed8c5f39b05ca040ad83d696364a /kernel/printk
parent576bb2d8e37a75a27400849327b996f330bc2380 (diff)
parent8076972468584d4a21dab9aa50e388b3ea9ad8c7 (diff)
Merge tag 'printk-for-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk fix from Petr Mladek: - Prevent scheduling in an atomic context when printk() takes over the console flushing duty * tag 'printk-for-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: Update @console_may_schedule in console_trylock_spinning()
Diffstat (limited to 'kernel/printk')
-rw-r--r--kernel/printk/printk.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index ca5146006b94..adf99c05adca 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2009,6 +2009,12 @@ static int console_trylock_spinning(void)
*/
mutex_acquire(&console_lock_dep_map, 0, 1, _THIS_IP_);
+ /*
+ * Update @console_may_schedule for trylock because the previous
+ * owner may have been schedulable.
+ */
+ console_may_schedule = 0;
+
return 1;
}