Received: by 2002:a05:7412:a9a3:b0:f9:327e:43ab with SMTP id o35csp159826rdh; Mon, 18 Dec 2023 07:10:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmD6ylO+WEOcgYRa1xRP2bhMYQ4NBkodXcj83fdXT82fBIsKihGSgJr0JQkyZPxUbMWzHy X-Received: by 2002:a17:906:287:b0:a1f:9cfd:5d9 with SMTP id 7-20020a170906028700b00a1f9cfd05d9mr6855687ejf.9.1702912212182; Mon, 18 Dec 2023 07:10:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702912212; cv=none; d=google.com; s=arc-20160816; b=X6WedJ2NL9yi+xYmmKB2rr2vZcmBVxK8shiaRcWAgqGwWow/o0onYsf2OvJAAkjvY+ WHsKvR/HyI63r7kB6ppvxpiDM4sUbOZezeX/LPDcLh/2XN4kK3q2QP4Po52WTTGL7V+u kZNYPnd4tOZo517/jzfHTLkanBoNPSrcZM6P04ZC2lFLJe+Xry8llmfJ/B7TKT18Jfw+ +48LUvAPB0VjSvrixU3yXUs+B1AHsVZcHB91t2xnTflC1msj04PAzVK0oBacK6n5Vhuy Qj0P62yjVZqD+FoCAgusWVef8v2s9x67T1uZdurKZw2Mu5aJjdOZAJa5Q7fCaMdGbDWV AOrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=tBZ7uD7GaxOVaibV5YRBGv1VefxSzmIzGaiiwr1o/Dw=; fh=z7dP0sUsXLtnomzA6+FUC3zkdfBao0VqwDEfI89QmpM=; b=viYgxIxwtMSHspxubUIsW0s7BYtPs4aahStyGMaWA9EsjWtLi/xxsirxNcxp6kYD7j u7rMXsdOZucq7b9IPj0aY1FeCpV9dlTNaZaTM6d5UsQ5D2FpQTyKHYj3G14jluaOchud HERDmY9sMhVGLlofVNd+zMsQZg0inWEPezhb3kmBIrYqphOk8dW9CDyNcJpsfHAlFnJZ F+WHUAlAKeLMb6M+foqF7eU84jOczINu5w0EdQDn0hWwzWf5GMYpQ2KX4966IbngKVX/ O6j08mjpJPhkJQfxHljjRIVNrQwoToE5w/66vbv7NWdNufMW3g6V4TevpCxCPWB6RQKm lLRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FCeuPAZQ; spf=pass (google.com: domain of linux-kernel+bounces-3894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n8-20020a170906700800b00a22fb3af196si5065775ejj.881.2023.12.18.07.10.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 07:10:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FCeuPAZQ; spf=pass (google.com: domain of linux-kernel+bounces-3894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id EAF9E1F21C09 for ; Mon, 18 Dec 2023 15:10:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED8753A1D5; Mon, 18 Dec 2023 15:10:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FCeuPAZQ" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17FD83A1C7; Mon, 18 Dec 2023 15:10:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702912203; x=1734448203; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=H2JiMZF2Ij39VAVR9TnJ4A+j9YTlsOjpmC1hsIFWk04=; b=FCeuPAZQXo6EDHVAwk6JCXJV49ZKDukliJ15s4RuAwlsX/NwLC2h6uf8 eNfToHwPPKk0ew9ELhGgAK0eRq4QhNNVf8ZlkpqhdapBGuaLlhJ9YfG64 o3ZZamaLrFGoN+0yP0i1qo/7ViwxwBSb+CRtD2B4cd6VUGGbVf9Nwv1PG PAPkM9J6hOUQ7Bwci6ezN+I1ig4KtntJUYtRuQJf2Ckc72/54/5Hs3gHk MTNu6+kJBbZH07+UvTMYUxiaEKNTCyi9ZGZZ9cI/APYtbGLYOyVF6Ygx0 PWC8QCxjpvd0wLlk10KSovu11+n+47a5fWUgOIyIh9sOE7GKUnWyCbfBS Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="14203970" X-IronPort-AV: E=Sophos;i="6.04,285,1695711600"; d="scan'208";a="14203970" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 07:10:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="1106975744" X-IronPort-AV: E=Sophos;i="6.04,285,1695711600"; d="scan'208";a="1106975744" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga005.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Dec 2023 07:09:57 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rFFFh-00000006yC9-47z3; Mon, 18 Dec 2023 17:09:53 +0200 Date: Mon, 18 Dec 2023 17:09:53 +0200 From: Andy Shevchenko To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky , "David S . Miller" , Dhruva Gole , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: Re: [RFC PATCH v5 1/6] printk: Save console options for add_preferred_console_match() Message-ID: References: <20231218071020.21805-1-tony@atomide.com> <20231218071020.21805-2-tony@atomide.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218071020.21805-2-tony@atomide.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Mon, Dec 18, 2023 at 09:09:48AM +0200, Tony Lindgren wrote: > Driver subsystems may need to translate the preferred console name to the > character device name used. We already do some of this in console_setup() > with a few hardcoded names, but that does not scale well. > > The console options are parsed early in console_setup(), and the consoles > are added with __add_preferred_console(). At this point we don't know much > about the character device names and device drivers getting probed. > > To allow driver subsystems to set up a preferred console, let's save the > kernel command line console options. To add a preferred console from a > driver subsystem with optional character device name translation, let's > add a new function add_preferred_console_match(). > > This allows the serial core layer to support console=DEVNAME:0.0 style > hardware based addressing in addition to the current console=ttyS0 style > naming. And we can start moving console_setup() character device parsing > to the driver subsystem specific code. > > We use a separate array from the console_cmdline array as the character > device name and index may be unknown at the console_setup() time. And > eventually there's no need to call __add_preferred_console() until the > subsystem is ready to handle the console. > > Adding the console name in addition to the character device name, and a > flag for an added console, could be added to the struct console_cmdline. > And the console_cmdline array handling could be modified accordingly. But > that complicates things compared saving the console options, and then > adding the consoles when the subsystems handling the consoles are ready. ... > +#include > +#include > +#include A nit: uXX require types.h. > +#include -- With Best Regards, Andy Shevchenko