Unverified Commit 42a67bc7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files
parents 72d884f2 e6471ff3
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -2426,7 +2426,7 @@ void console_unlock(void)
	static char text[LOG_LINE_MAX + PREFIX_MAX];
	static int panic_console_dropped;
	unsigned long flags;
	bool do_cond_resched, retry;
	bool do_cond_resched, retry, locked = false;

	if (console_suspended) {
		up_console_sem();
@@ -2469,6 +2469,7 @@ void console_unlock(void)

		printk_safe_enter_irqsave(flags);
		raw_spin_lock(&logbuf_lock);
		locked = true;
		if (console_seq < log_first_seq) {
			len = snprintf(text, sizeof(text),
				       "** %llu printk messages dropped **\n",
@@ -2520,6 +2521,7 @@ void console_unlock(void)
		}
		console_idx = log_next(console_idx);
		console_seq++;
		locked = false;
		raw_spin_unlock(&logbuf_lock);

		/*
@@ -2539,18 +2541,19 @@ void console_unlock(void)
			return;
		}

		printk_safe_exit_irqrestore(flags);

		/* Allow panic_cpu to take over the consoles safely */
		if (abandon_console_lock_in_panic())
			break;

		printk_safe_exit_irqrestore(flags);

		if (do_cond_resched)
			cond_resched();
	}

	console_locked = 0;

	if (likely(locked))
		raw_spin_unlock(&logbuf_lock);

	up_console_sem();