VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   30 Branches   50 Tags
author: Chao Qin <chao.qin@intel.com> 2021-07-19 10:26:50 +0800 committer: Minda Chen <minda.chen@starfivetech.com> 2023-11-06 19:24:38 +0800 commit: 5c8a87a305afa290ec0ee321efd0581ac5c02073 parent: bc0be07ded5ab2ec527d89f77747df463bcaddf7
Commit Summary:
printk: Enhance the condition check of msleep in pr_flush()
Diffstat:
1 file changed, 3 insertions, 1 deletion
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index 9b57dbbdacd7..dbdff0a4704b 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3649,7 +3649,9 @@ bool pr_flush(int timeout_ms, bool reset_on_progress)
 	u64 diff;
 	u64 seq;
 
-	may_sleep = (preemptible() && !in_softirq());
+	may_sleep = (preemptible() &&
+		     !in_softirq() &&
+		     system_state >= SYSTEM_RUNNING);
 
 	seq = prb_next_seq(prb);