summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-03-26 17:25:57 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2024-03-26 17:25:57 +0100
commit7033999ecd7b8cf9ea59265035a0150961e023ee (patch)
tree739419451657ed8c5f39b05ca040ad83d696364a /kernel
parentMerge tag 'pwm/for-6.9-rc2-fixes' of git://git.kernel.org/pub/scm/linux/kerne... (diff)
parentprintk: Update @console_may_schedule in console_trylock_spinning() (diff)
downloadlinux-7033999ecd7b8cf9ea59265035a0150961e023ee.tar.xz
linux-7033999ecd7b8cf9ea59265035a0150961e023ee.zip
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')
-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;
}