File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2533,6 +2533,7 @@ void console_unlock(void)
25332533 bool do_cond_resched , retry ;
25342534 struct printk_info info ;
25352535 struct printk_record r ;
2536+ u64 __maybe_unused next_seq ;
25362537
25372538 if (console_suspended ) {
25382539 up_console_sem ();
@@ -2642,8 +2643,10 @@ void console_unlock(void)
26422643 cond_resched ();
26432644 }
26442645
2645- console_locked = 0 ;
2646+ /* Get consistent value of the next-to-be-used sequence number. */
2647+ next_seq = console_seq ;
26462648
2649+ console_locked = 0 ;
26472650 up_console_sem ();
26482651
26492652 /*
@@ -2652,7 +2655,7 @@ void console_unlock(void)
26522655 * there's a new owner and the console_unlock() from them will do the
26532656 * flush, no worries.
26542657 */
2655- retry = prb_read_valid (prb , console_seq , NULL );
2658+ retry = prb_read_valid (prb , next_seq , NULL );
26562659 printk_safe_exit_irqrestore (flags );
26572660
26582661 if (retry && console_trylock ())
You can’t perform that action at this time.
0 commit comments