Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF978C433F5 for ; Mon, 30 May 2022 13:32:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 125F110E8F1; Mon, 30 May 2022 13:32:34 +0000 (UTC) Received: from ams.source.kernel.org (unknown [145.40.68.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id B127C10E952 for ; Mon, 30 May 2022 13:32:15 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 9CA10B80D89; Mon, 30 May 2022 13:32:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81413C36AE3; Mon, 30 May 2022 13:32:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653917531; bh=+ehzoZ1+4/6eIf04m+qPZ2eANMxYBdwQHqalydfBe80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bhTaRygIMpHU18YNO9vkdcqxyOU9vJnhWnSNXl+xEFK6zAVo3reY58beAsghdyUuy DdSrU7t8tZBkQcNAkRzbXqIu0fEGQmWuRKTJZPwwxKNGPoRDdViQioABkfv7G3BVzs ju11hxzOq9ctMUadM4/b2zS8gMgDLMyw62LFuKvJt6kgiHJMx31Ir4kYrLDRcI6/j9 ZMrJ7Gdn9fjdMDUnJalzt+q/gQFw3w3U39MFKQyQdwtSfgq0brZG8ptpwLafwYI2GD HKyXBGhV1IXlToEu4m1iKf1MgAiLEtvuAa41t2gmVrYE8gQxiklMwD6OnnnUxsw+sH EElbyO/+wnzbg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 013/135] fbcon: Consistently protect deferred_takeover with console_lock() Date: Mon, 30 May 2022 09:29:31 -0400 Message-Id: <20220530133133.1931716-13-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220530133133.1931716-1-sashal@kernel.org> References: <20220530133133.1931716-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-fbdev@vger.kernel.org, Thomas Zimmermann , Du Cheng , Tetsuo Handa , Daniel Vetter , deller@gmx.de, javierm@redhat.com, dri-devel@lists.freedesktop.org, Claudio Suarez , Daniel Vetter , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Daniel Vetter [ 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 later. Acked-by: Sam Ravnborg Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Du Cheng Cc: Tetsuo Handa Cc: Claudio Suarez Cc: Thomas Zimmermann Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-14-daniel.vetter@ffwll.ch Signed-off-by: Sasha Levin --- 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 2fc1b80a26ad..9a8ae6fa6ecb 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -3265,6 +3265,9 @@ static void fbcon_register_existing_fbs(struct work_struct *work) console_lock(); + deferred_takeover = false; + logo_shown = FBCON_LOGO_DONTSHOW; + for_each_registered_fb(i) fbcon_fb_registered(registered_fb[i]); @@ -3282,8 +3285,6 @@ static int fbcon_output_notifier(struct notifier_block *nb, pr_info("fbcon: Taking over console\n"); dummycon_unregister_output_notifier(&fbcon_output_nb); - deferred_takeover = false; - logo_shown = FBCON_LOGO_DONTSHOW; /* We may get called in atomic context */ schedule_work(&fbcon_deferred_takeover_work); -- 2.35.1