Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp723328rwi; Thu, 27 Oct 2022 06:56:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7J4z+sp9EdqxxiRGNKEZwQ3nk3n7jE3Y0WPF/FW2yJUQ/4NBS9qQCTzyoNnBJtyKOBOepu X-Received: by 2002:a05:6402:22a5:b0:462:b393:f281 with SMTP id cx5-20020a05640222a500b00462b393f281mr681132edb.379.1666879014463; Thu, 27 Oct 2022 06:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666879014; cv=none; d=google.com; s=arc-20160816; b=MiwTOPI506oLdF1iVSc8Xmo1tZ863frq4PiVwM9fmxQI+sWfpF5lmqBPvg4dzLNtSc rRhmOQEbwtSs+uvMIopahbg42iaozthKBIhF0dVSRB/44hGvlNqSM82aoagA546kzftq vobwqQsM/G57/bT1NcPlEqFBWYggMSe9pVW3pNdSzfwLYTBewEOYfp4i25pGhgG4FVDb Tt7nX92IsaTl59ThaGrRF1G6Tw2FiO6NjDwxUMsGcva/TWBosF8ehskVPMQ9CJCUk+Bx p8S1d2LMbX3UWq+gr4n3kqqLDvfjbWFIJlp91s3/o7y8BspGkvI+Npjz/ke+EEIxbR29 S9mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=qUNnaSiTpnz8zitnV3znO1WDSOsrJ4JHkGUBNirU8e0=; b=lZAvLGoTM6AYmcAWEBTIKaGxUJ6cjDnCxqxgBB3ydFR/WwioIGmNBZTrtBO8K6XzSu xYi6kkB+RTBftrml+udMIR4Pv8XQPmc8WioabxsFn70I22rMcG8E13j8CxEQlkodqg+u bjZefo/yPWkXto0e6M1gw5x+XLSrWEUflRFETKvzNlHIRQy9cOJxPBhcNT3gLxxjmIVm IuF+nEX4sfzI+Q0PCOiCGlVty2Dk1ANQr5AbNzwax7auRT0CuxmkbsdevZjF4IdlYyzw EpckmZu07RtdmhSWPdLUyE/6BCTwZHxIQjnvje4TVB0jEDYvKHO5tHOH6J67WJnXkwH8 WJMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HZYNVE0j; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id st11-20020a170907c08b00b0078dacbcaa7asi1053233ejc.992.2022.10.27.06.56.28; Thu, 27 Oct 2022 06:56:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=HZYNVE0j; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236156AbiJ0Nfb (ORCPT + 99 others); Thu, 27 Oct 2022 09:35:31 -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 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,INVALID_DATE_TZ_ABSURD, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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