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 4006FFA3742 for ; Thu, 27 Oct 2022 13:35:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236131AbiJ0Nfc (ORCPT ); Thu, 27 Oct 2022 09:35:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236101AbiJ0Nf3 (ORCPT ); Thu, 27 Oct 2022 09:35:29 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AEAB12A35D; Thu, 27 Oct 2022 06:35:27 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666877724; h=from:from:reply-to:subject:subject: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=qUNnaSiTpnz8zitnV3znO1WDSOsrJ4JHkGUBNirU8e0=; b=HZYNVE0jgBeZDZOVHj4C7tlK31pHEp+SXTTvp39STk13iUrdwUHjJrlrCXHvFCpGXc3z2l hRvUlmvJRVpPsC5BwmbFW+S9u4cXXQzUxgxkmKmyJzZLys+51YXAP3x2YuDGBtIB6b49/p bXEJf8/vIKh/DZUYRYH3QflGEAudHc2pjG4s9qcZxdY14pwWa+XWPsXQPl4trs0U59t/Kq cJLCs3aEi1nh7zZZI7M4l90knFfp2TLdjBRfXQhQNbYF2GUkJg0UeDhqdkCHcBDQVuo25r YGzP5qFFP5joDEDs1sAaY7fP7OsQ/2qUbujdaR0huZcrLDPz+BlH0aYCShkbQQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666877724; h=from:from:reply-to:subject:subject: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=qUNnaSiTpnz8zitnV3znO1WDSOsrJ4JHkGUBNirU8e0=; b=K8svDYQnhUfwQTDx+8cl3c6kL/K6magEDxEws98VvnaxAhrM/pDkWdvd4JUu3Bnj6xHQOa g9lKHnKVwORNFTDQ== To: Petr Mladek 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 In-Reply-To: References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-39-john.ogness@linutronix.de> Date: Thu, 27 Oct 2022 15:41:23 +0206 Message-ID: <87v8o5crtw.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. John 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 93C7BECAAA1 for ; Thu, 27 Oct 2022 13:35:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 886F710E63C; Thu, 27 Oct 2022 13:35:30 +0000 (UTC) Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9B00110E63D for ; Thu, 27 Oct 2022 13:35:26 +0000 (UTC) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666877724; h=from:from:reply-to:subject:subject: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=qUNnaSiTpnz8zitnV3znO1WDSOsrJ4JHkGUBNirU8e0=; b=HZYNVE0jgBeZDZOVHj4C7tlK31pHEp+SXTTvp39STk13iUrdwUHjJrlrCXHvFCpGXc3z2l hRvUlmvJRVpPsC5BwmbFW+S9u4cXXQzUxgxkmKmyJzZLys+51YXAP3x2YuDGBtIB6b49/p bXEJf8/vIKh/DZUYRYH3QflGEAudHc2pjG4s9qcZxdY14pwWa+XWPsXQPl4trs0U59t/Kq cJLCs3aEi1nh7zZZI7M4l90knFfp2TLdjBRfXQhQNbYF2GUkJg0UeDhqdkCHcBDQVuo25r YGzP5qFFP5joDEDs1sAaY7fP7OsQ/2qUbujdaR0huZcrLDPz+BlH0aYCShkbQQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666877724; h=from:from:reply-to:subject:subject: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=qUNnaSiTpnz8zitnV3znO1WDSOsrJ4JHkGUBNirU8e0=; b=K8svDYQnhUfwQTDx+8cl3c6kL/K6magEDxEws98VvnaxAhrM/pDkWdvd4JUu3Bnj6xHQOa g9lKHnKVwORNFTDQ== To: Petr Mladek Subject: Re: [PATCH printk v2 38/38] printk, xen: fbfront: create/use safe function for forcing preferred In-Reply-To: References: <20221019145600.1282823-1-john.ogness@linutronix.de> <20221019145600.1282823-39-john.ogness@linutronix.de> Date: Thu, 27 Oct 2022 15:41:23 +0206 Message-ID: <87v8o5crtw.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain 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 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. John