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 9C048FA3741 for ; Thu, 27 Oct 2022 14:27:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235428AbiJ0O1n (ORCPT ); Thu, 27 Oct 2022 10:27:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234196AbiJ0O1j (ORCPT ); Thu, 27 Oct 2022 10:27:39 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 943B118980D; Thu, 27 Oct 2022 07:27:38 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3E3561F8E8; Thu, 27 Oct 2022 14:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666880857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0qpq/M/opCRpvF3FSdjlTdiqC45BiRz5sGZaOTgW0Sk=; b=dX95m2lVjr68CqcXgfwMM+/vozHuhOFtUCxWGxQK7iOx92ZJhMygrLLabYB2Nr2Manu0tV m/6CGaOrj0vRvXbgzYWILO8IFQOdNwBx5tz8nxr/sNk7i3vSNqkGv1AUg5R8xaRl9jxwyW tE/LzH7OQv6HOVt/Xobnc/3i6OgSkd0= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E1B092C141; Thu, 27 Oct 2022 14:27:36 +0000 (UTC) Date: Thu, 27 Oct 2022 16:27:36 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , linux-kernel@vger.kernel.org, Helge Deller , Greg Kroah-Hartman , Javier Martinez Canillas , Thomas Zimmermann , Juergen Gross , Boris Ostrovsky , Tom Rix , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH printk v2 38/38] printk, xen: fbfront: create/use safe function for forcing preferred Message-ID: References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-39-john.ogness@linutronix.de> <87v8o5crtw.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v8o5crtw.fsf@jogness.linutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2022-10-27 15:41:23, John Ogness wrote: > On 2022-10-27, Petr Mladek wrote: > >> - if (c) { > >> - unregister_console(c); > >> - c->flags |= CON_CONSDEV; > >> - c->flags &= ~CON_PRINTBUFFER; /* don't print again */ > >> - register_console(c); > >> - } > >> + if (c) > >> + console_force_preferred(c); > > > > I would prefer to fix this a clean way. > > > > [...] > > > > I would suggest to implement: > > > > [...] > > > > It is a more code. But it is race-free. Also it is much more clear > > what is going on. > > > > How does this sound, please? > > I wasn't sure if any of the other preferred-console magic in > register_console() was needed, which is why I kept a full > register_console() call. But if it really is just about forcing it the > head and setting a new CON_CONSDEV, then your suggestion is much > simpler. Thanks. I believe that it is just this. I have spent a lot of time investigating these hacks when thinking about refactoring of register_console(). Best Regards, Petr 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 AF171ECAAA1 for ; Thu, 27 Oct 2022 14:27:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42ED210E64F; Thu, 27 Oct 2022 14:27:42 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 91E6E10E64F for ; Thu, 27 Oct 2022 14:27:38 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 3E3561F8E8; Thu, 27 Oct 2022 14:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1666880857; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0qpq/M/opCRpvF3FSdjlTdiqC45BiRz5sGZaOTgW0Sk=; b=dX95m2lVjr68CqcXgfwMM+/vozHuhOFtUCxWGxQK7iOx92ZJhMygrLLabYB2Nr2Manu0tV m/6CGaOrj0vRvXbgzYWILO8IFQOdNwBx5tz8nxr/sNk7i3vSNqkGv1AUg5R8xaRl9jxwyW tE/LzH7OQv6HOVt/Xobnc/3i6OgSkd0= Received: from suse.cz (unknown [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E1B092C141; Thu, 27 Oct 2022 14:27:36 +0000 (UTC) Date: Thu, 27 Oct 2022 16:27:36 +0200 From: Petr Mladek To: John Ogness Subject: Re: [PATCH printk v2 38/38] printk, xen: fbfront: create/use safe function for forcing preferred Message-ID: References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-39-john.ogness@linutronix.de> <87v8o5crtw.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v8o5crtw.fsf@jogness.linutronix.de> 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: Juergen Gross , linux-fbdev@vger.kernel.org, Greg Kroah-Hartman , Helge Deller , linux-kernel@vger.kernel.org, Steven Rostedt , Javier Martinez Canillas , Sergey Senozhatsky , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Tom Rix , Thomas Gleixner , Boris Ostrovsky Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu 2022-10-27 15:41:23, John Ogness wrote: > On 2022-10-27, Petr Mladek wrote: > >> - if (c) { > >> - unregister_console(c); > >> - c->flags |= CON_CONSDEV; > >> - c->flags &= ~CON_PRINTBUFFER; /* don't print again */ > >> - register_console(c); > >> - } > >> + if (c) > >> + console_force_preferred(c); > > > > I would prefer to fix this a clean way. > > > > [...] > > > > I would suggest to implement: > > > > [...] > > > > It is a more code. But it is race-free. Also it is much more clear > > what is going on. > > > > How does this sound, please? > > I wasn't sure if any of the other preferred-console magic in > register_console() was needed, which is why I kept a full > register_console() call. But if it really is just about forcing it the > head and setting a new CON_CONSDEV, then your suggestion is much > simpler. Thanks. I believe that it is just this. I have spent a lot of time investigating these hacks when thinking about refactoring of register_console(). Best Regards, Petr