[PATCH AUTOSEL 4.19 07/38] fbcon: Consistently protect deferred_takeover with console_lock()

Sasha Levin sashal at kernel.org
Mon May 30 13:48:53 UTC 2022

From: Daniel Vetter <daniel.vetter at ffwll.ch>

[ Upstream commit 43553559121ca90965b572cf8a1d6d0fd618b449 ]

This shouldn't be a problem in practice since until we've actually
taken over the console there's nothing we've registered with the
console/vt subsystem, so the exit/unbind path that check this can't
do the wrong thing. But it's confusing, so fix it by moving it a tad

Acked-by: Sam Ravnborg <sam at ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
Cc: Daniel Vetter <daniel at ffwll.ch>
Cc: Du Cheng <ducheng2 at gmail.com>
Cc: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp>
Cc: Claudio Suarez <cssk at net-c.es>
Cc: Thomas Zimmermann <tzimmermann at suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-14-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin <sashal at kernel.org>
 drivers/video/fbdev/core/fbcon.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index bf7959fdf9f4..7c2582892eab 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -3314,6 +3314,9 @@ static void fbcon_register_existing_fbs(struct work_struct *work)
+	deferred_takeover = false;
+	logo_shown = FBCON_LOGO_DONTSHOW;
@@ -3331,8 +3334,6 @@ static int fbcon_output_notifier(struct notifier_block *nb,
 	pr_info("fbcon: Taking over console\n");
-	deferred_takeover = false;
-	logo_shown = FBCON_LOGO_DONTSHOW;
 	/* We may get called in atomic context */

More information about the dri-devel mailing list