Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp581656pxb; Tue, 15 Feb 2022 22:48:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJzeo3L5Fz1It5GyII2h5+oo/Nb5BGsEFX+U3qVeg3Jdb0dd7yR3dsb2fV0Da3vnmwhdgJao X-Received: by 2002:a17:903:300c:b0:14d:bfde:fcf3 with SMTP id o12-20020a170903300c00b0014dbfdefcf3mr1167980pla.91.1644994118594; Tue, 15 Feb 2022 22:48:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644994118; cv=none; d=google.com; s=arc-20160816; b=ICy4m3DiCSSQi8MFs/BRAKUdgOeVPPCG4JKPTLKqch98eQ5Dvvpwx4ftfr+Umy1wdV CuTXHs1DXtMyJ9T/YlkwQ8pffITySSq4FcfrVnPeXyyEo78YaMS4inMAT9hqZaOa6tit /B58ZvB1KAcwIXlvNWMkL+dniCfjkzusx4F9nEzk/kyfEBEFXWyiUu9ougx3OgabT0C0 fYpodgfjfFW9FAcyvJ1H+sgQARRxSzo4QN7itoC2mxeIA6FBAkW7k7jnWFQEis0ivHYu s92MHuxa+3UCtz3Z6XzWQt5WmJF1n9AMETzcS0H5DBXXwBxZ8zn1Gk9r1mNwvF4LpOCn yWiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=f5aYonr4ORj/YqnUtWpVYe8Wlx+8kb4tQX1zRaFkQXM=; b=dLsW2QMo5AHJ6Q0Enx+NmkGOx5NqJvLRIpQZVMWJF5bltiZvSZH0F/R6IqlXAty+4G FX+/dkeZfbvwCQAej4eTyfCGyiNQ3dNMx6RIeMEljl3NYecXimdp1W/MRQIkP31ML5P5 dd7YemevQvm9C2edzVN7iwIaMqJ4B2h+Dk0m1BfvQ+MyOiZd3BQdV2/IiSveg1siCnhn XTrfxfQsv4ZxExfpb1F7HBrCTXhuFIkZvlECxHlXfo1AmCWJ2cytXGo/WECKQ/CXJmtW xfdFevFfyMy8ZZwMV6XHG/oByG1gB/J+lX0oVO66ZCNnnn/Ux85IY1SR2sFPy5uP6rGC 5NsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=eRPqXI1w; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bm10si5363948pgb.415.2022.02.15.22.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:48:38 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=eRPqXI1w; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A8D1D20B394; Tue, 15 Feb 2022 22:34:53 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242909AbiBOSLH (ORCPT + 99 others); Tue, 15 Feb 2022 13:11:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241262AbiBOSLF (ORCPT ); Tue, 15 Feb 2022 13:11:05 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F31119432 for ; Tue, 15 Feb 2022 10:10:55 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id D66921F37B; Tue, 15 Feb 2022 18:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1644948653; 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=f5aYonr4ORj/YqnUtWpVYe8Wlx+8kb4tQX1zRaFkQXM=; b=eRPqXI1wLrkr5zsnIdC54ETnDCn4VS64jwF4HQ2vVHaeBfXXXd3ZQz2+E/ziKmQ4iyxliC PrgPFP8biPRmTW/PERINncy88J8B4Y/RY5XOuFeG522brrR3nsJYUDAFAMiHjJ7JVXZJnS gf1x1/v38gCszbe1s8x2Jd4R9koZ34o= Received: from suse.cz (unknown [10.100.216.66]) (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 BD709A3B83; Tue, 15 Feb 2022 18:10:53 +0000 (UTC) Date: Tue, 15 Feb 2022 19:10:50 +0100 From: Petr Mladek To: Andre Kalb Cc: john.ogness@linutronix.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, senozhatsky@chromium.org Subject: Re: [PATCH v2] printk: Set console_set_on_cmdline=1 when __add_preferred_console() is called with user_specified == true Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon 2022-02-14 14:21:29, Andre Kalb wrote: > From: Andre Kalb > > In case of using console="" or console=null > set console_set_on_cmdline=1 to disable "stdout-path" node from DT. > > We basically need to set it every time when __add_preferred_console() > is called with parameter 'user_specified' set. > Therefore we can move setting it into a helper function that is > called from __add_preferred_console(). > > Suggested-by: Petr Mladek > Signed-off-by: Andre Kalb > --- > Changelog v1 to v2: > Move console_set_on_cmdling into separate function set_user_specified(), which is called from > __add_preferred_console(). > > The old patch v1 could be used to backport to stable 5.4 and lower. > --- > kernel/printk/printk.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 82abfaf3c2aa..3654695ca5d2 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -2324,6 +2324,15 @@ asmlinkage __visible void early_printk(const char *fmt, ...) > } > #endif > We should add a comment explaining the less obvious behavior as discussed in the thread. Something like: > +static void set_user_specified(struct console_cmdline *c, bool user_specified) > +{ > + if (!user_specified) > + return; > + /* * @c console was defined by the user on the command line. * Do not clear when added twice also by SPCR or the device tree. */ > + c->user_specified = true; /* At least one console defined by the user on the command line. */ > + console_set_on_cmdline = 1; > +} > + > static int __add_preferred_console(char *name, int idx, char *options, > char *brl_options, bool user_specified) > { With the above comments: Reviewed-by: Petr Mladek Sergey, is it enough from your POV, please? Best Regards, Petr