From mboxrd@z Thu Jan 1 00:00:00 1970 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 B2FB6C433FE for ; Fri, 4 Feb 2022 19:45:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AD48610E5DE; Fri, 4 Feb 2022 19:45:52 +0000 (UTC) Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id D7E0610E1D4 for ; Fri, 4 Feb 2022 19:45:50 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id 31c0cf47-85f3-11ec-b20b-0050568c148b; Fri, 04 Feb 2022 19:46:49 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 37B32194B91; Fri, 4 Feb 2022 20:45:49 +0100 (CET) Date: Fri, 4 Feb 2022 20:45:46 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Daniel Vetter Subject: Re: [PATCH 15/21] fbcon: Consistently protect deferred_takeover with console_lock() Message-ID: References: <20220131210552.482606-1-daniel.vetter@ffwll.ch> <20220131210552.482606-16-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131210552.482606-16-daniel.vetter@ffwll.ch> 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: linux-fbdev@vger.kernel.org, Du Cheng , Tetsuo Handa , Intel Graphics Development , LKML , DRI Development , Claudio Suarez , Thomas Zimmermann , Daniel Vetter Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Jan 31, 2022 at 10:05:46PM +0100, Daniel Vetter wrote: > 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. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Du Cheng > Cc: Tetsuo Handa > Cc: Claudio Suarez > Cc: Thomas Zimmermann It had helped me if the commitlog was explicit that the deferred_takeover falg is moved to the worker function to reset it as late as possible. With the commit log updated: Acked-by: Sam Ravnborg > --- > 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 496bc5f2133e..11b9f962af6f 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -3247,6 +3247,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]); > > @@ -3264,8 +3267,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.33.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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 15163C433EF for ; Fri, 4 Feb 2022 19:45:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AAF9510E58A; Fri, 4 Feb 2022 19:45:51 +0000 (UTC) Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id D84EA10E58A for ; Fri, 4 Feb 2022 19:45:50 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id 31c0cf47-85f3-11ec-b20b-0050568c148b; Fri, 04 Feb 2022 19:46:49 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 37B32194B91; Fri, 4 Feb 2022 20:45:49 +0100 (CET) Date: Fri, 4 Feb 2022 20:45:46 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Daniel Vetter Message-ID: References: <20220131210552.482606-1-daniel.vetter@ffwll.ch> <20220131210552.482606-16-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131210552.482606-16-daniel.vetter@ffwll.ch> Subject: Re: [Intel-gfx] [PATCH 15/21] fbcon: Consistently protect deferred_takeover with console_lock() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fbdev@vger.kernel.org, Du Cheng , Tetsuo Handa , Intel Graphics Development , LKML , DRI Development , Thomas Zimmermann , Daniel Vetter Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Mon, Jan 31, 2022 at 10:05:46PM +0100, Daniel Vetter wrote: > 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. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Du Cheng > Cc: Tetsuo Handa > Cc: Claudio Suarez > Cc: Thomas Zimmermann It had helped me if the commitlog was explicit that the deferred_takeover falg is moved to the worker function to reset it as late as possible. With the commit log updated: Acked-by: Sam Ravnborg > --- > 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 496bc5f2133e..11b9f962af6f 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -3247,6 +3247,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]); > > @@ -3264,8 +3267,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.33.0 From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E758C433FE for ; Sat, 5 Feb 2022 23:02:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381180AbiBEXCC (ORCPT ); Sat, 5 Feb 2022 18:02:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235098AbiBEXCA (ORCPT ); Sat, 5 Feb 2022 18:02:00 -0500 Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CCAEC061348 for ; Sat, 5 Feb 2022 15:01:58 -0800 (PST) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id 31c0cf47-85f3-11ec-b20b-0050568c148b; Fri, 04 Feb 2022 19:46:49 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id 37B32194B91; Fri, 4 Feb 2022 20:45:49 +0100 (CET) Date: Fri, 4 Feb 2022 20:45:46 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Daniel Vetter Cc: DRI Development , linux-fbdev@vger.kernel.org, Thomas Zimmermann , Du Cheng , Tetsuo Handa , Intel Graphics Development , LKML , Claudio Suarez , Daniel Vetter Subject: Re: [PATCH 15/21] fbcon: Consistently protect deferred_takeover with console_lock() Message-ID: References: <20220131210552.482606-1-daniel.vetter@ffwll.ch> <20220131210552.482606-16-daniel.vetter@ffwll.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220131210552.482606-16-daniel.vetter@ffwll.ch> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 31, 2022 at 10:05:46PM +0100, Daniel Vetter wrote: > 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. > > Signed-off-by: Daniel Vetter > Cc: Daniel Vetter > Cc: Du Cheng > Cc: Tetsuo Handa > Cc: Claudio Suarez > Cc: Thomas Zimmermann It had helped me if the commitlog was explicit that the deferred_takeover falg is moved to the worker function to reset it as late as possible. With the commit log updated: Acked-by: Sam Ravnborg > --- > 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 496bc5f2133e..11b9f962af6f 100644 > --- a/drivers/video/fbdev/core/fbcon.c > +++ b/drivers/video/fbdev/core/fbcon.c > @@ -3247,6 +3247,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]); > > @@ -3264,8 +3267,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.33.0