From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 930DF146D7C for ; Tue, 25 Jun 2024 08:36:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719304592; cv=none; b=XvtlyDa8e9HBazni+1M/2XLvh5kre/6+p4R/B72tInAM1twxKfqkPO2AYHyP/0/aEq3REoeYif88EoSpMwzPY0dKNbzjcYEFJnCP9v6fTqRCa/RQlKAWmkd/QUWLJ2ElO+ZdGhkuuBmdeTQNOfyGLirWS8dzOjtDUFHhBDUkzuE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719304592; c=relaxed/simple; bh=dRHpzmSsFYDlsse5ShwVsot0eEz8ENEC+BQ1G/fIUGg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L0HirorzfrxBsbfKo0n9Pnqpd1/03z3hH1XdQ4O02XD7wRQTgyRQUUTrudEmW6qdtDb+40L7QhGOIVHLRYF6+evT8haGbGMban4BOaxQVJRP6niEtGMRkMhLbDQcJqeb2xpPYASAZLSq9VsgSDWoSNPfehaMBMY4AZugkTXynFI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=gieiIzEd; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="gieiIzEd" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2ec408c6d94so60208901fa.3 for ; Tue, 25 Jun 2024 01:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1719304588; x=1719909388; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FuS5DPpmOhroPWtajZKPoCKp87zKc8dy5+EvwOudsqM=; b=gieiIzEdJhnf3NlEFttCHc7pU32Gk2tZltm1/mD9HYrFdBr+KslMu6UZ0Y4M/3PUVK OYESWzM/B78r/6SdcLYueBxdJenM3wirP/aiynfjSRr8N43xacw8Fxe4L+vOIeDz+a1S sTcXZnyYwoMpqfb76HHkoWYMpSTyoNFjp9i7xJ1Ouecd0Ys5DVxc2zVhxbkKELzygDZT 3rRq4cph3NPXi6C6TE7RQ9YQKOPolvCUgzV/Ak0S+lL6jWmu2O7eOCqZU2BcAzKnw5m/ fIU9GORWAwCjxkhlgnKnuM9jHdE6YHKvGz/u9dooFMz0Qmcg9NuCZqLZfssJRxte2v6l 9zqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719304588; x=1719909388; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FuS5DPpmOhroPWtajZKPoCKp87zKc8dy5+EvwOudsqM=; b=xSYvZZjOwnb7Yi8VNajTAP5qqpQ9+62cR5Z83idAOBBz5jojCbHc9muE1TjjkAobZa xibMZ/C4mKGV5HKJvc4BR/Oay3H8MgCjE8nMK5SuT5DGTM+0C70ZF8mQu4NOU7uM0RDu MqOZMC3UxOdS/SbCNTbSbhnzHoqGeScuaSqbnaCrRw2E3wouxl7o9GBs6nDd+d9aYUu8 JTanCgMbfL/p8xw/oSHOb83mphhaCRysPxak14/vvHdkwwmyM4e6ylK8DKafPfiVvNOu WjJ5BsqDH3l/8OgCNWhgGZltSpaLlUwKjA40ByE4Hly8VBeuMHSgPP2qHnfHEixbo0c9 d5Zg== X-Forwarded-Encrypted: i=1; AJvYcCWVnEtKnd5RsWvnEdmMSEpjcZ2p5RJU+p7zldj2pdliYdIV2Plj1gRPMtPMcFbsO1Z8Nggcun0ewpgv2CxheCy9XOGDJsdrind/8kgU X-Gm-Message-State: AOJu0YzGY+NVHN9SBVAZ0yN7dqUVeYkr0F0G+E7EMpoupMWUEF+tzaSE ODFFNfy6r7gUY1hJ15mvnaR4Owxk2ol5RI0BKVgje5mNsyU2EuOgWp0VgGuluG0= X-Google-Smtp-Source: AGHT+IFJSQeKryvBLg7sTeJHjYSYhVOrI7eqMtkBjerN8ltNdjpw3ldSHWOmIRgJjXl3sI6jC2Lb0Q== X-Received: by 2002:a2e:9bc7:0:b0:2ec:30ee:6972 with SMTP id 38308e7fff4ca-2ec59328425mr50534431fa.24.1719304587672; Tue, 25 Jun 2024 01:36:27 -0700 (PDT) Received: from pathway.suse.cz (nat2.prg.suse.com. [195.250.132.146]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb5e2e46sm75625205ad.223.2024.06.25.01.36.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 01:36:27 -0700 (PDT) Date: Tue, 25 Jun 2024 10:36:17 +0200 From: Petr Mladek To: Greg Kroah-Hartman Cc: Tony Lindgren , Linus Torvalds , Jiri Slaby , Steven Rostedt , John Ogness , Sergey Senozhatsky , Andy Shevchenko , Tony Lindgren , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/4] Fixes for console command line ordering Message-ID: References: <20240620124541.164931-1-tony.lindgren@linux.intel.com> <2024062403-skid-gotten-7585@gregkh> <2024062551-hubcap-bauble-fae5@gregkh> 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: <2024062551-hubcap-bauble-fae5@gregkh> On Tue 2024-06-25 08:20:06, Greg Kroah-Hartman wrote: > On Tue, Jun 25, 2024 at 08:12:03AM +0300, Tony Lindgren wrote: > > On Mon, Jun 24, 2024 at 03:35:39PM +0200, Greg Kroah-Hartman wrote: > > > On Fri, Jun 21, 2024 at 04:44:10PM +0200, Petr Mladek wrote: > > > > Added Linus into Cc. > > > > > > > > On Thu 2024-06-20 15:45:25, Tony Lindgren wrote: > > > > > Hi, > > > > > > > > > > Recent changes to add support for DEVNAME:0.0 style consoles caused a > > > > > regression with the preferred console order where the last console on > > > > > the kernel command line is no longer the preferred console. > > > > > > > > > > The following four changes fix the issue using Petr's suggestion that > > > > > does not involve calling __add_preferred_console() later on again, and > > > > > adds the deferred consoles to the console_cmdline[] directly to be > > > > > updated when the console is ready. > > > > > > > > > > We revert the earlier printk related changes, and then add back the > > > > > DEVNAME:0.0 functionality based on Petr's code snippet. And we end up > > > > > reducing the code quite a bit too this way. > > > > > > > > > > And we also revert all the unusable serial core console quirk handling, > > > > > it does not do anything for the legacy "ttyS" named consoles. And then > > > > > we add a minimal serial_base_match_and_update_preferred_console(). > > > > > > > > > > The reason we want DEVNAME:0.0 style consoles is it helps addressing the > > > > > console based on the connected serial port controller device rather than > > > > > using the hardcoded ttyS addressing. And that helps with issues related > > > > > to the console moving around after togging the HSUART option in the BIOS, > > > > > or when new ports are enabled in devicetree and aliases are not updated. > > > > > > > > > > Tony Lindgren (4): > > > > > printk: Revert add_preferred_console_match() related commits > > > > > printk: Add match_devname_and_update_preferred_console() > > > > > serial: core: Revert unusable console quirk handling > > > > > serial: core: Add serial_base_match_and_update_preferred_console() > > > > > > > > > > drivers/tty/serial/8250/8250_core.c | 5 - > > > > > drivers/tty/serial/serial_base.h | 22 +--- > > > > > drivers/tty/serial/serial_base_bus.c | 116 +++------------------ > > > > > drivers/tty/serial/serial_core.c | 2 +- > > > > > include/linux/printk.h | 5 +- > > > > > kernel/printk/Makefile | 2 +- > > > > > kernel/printk/conopt.c | 146 --------------------------- > > > > > kernel/printk/console_cmdline.h | 7 +- > > > > > kernel/printk/printk.c | 122 ++++++++++++++++------ > > > > > 9 files changed, 112 insertions(+), 315 deletions(-) > > > > > delete mode 100644 kernel/printk/conopt.c > > > > > > > > The patchset looks ready for linux-next. And I have pushed it > > > > into printk/linux.git, branch for-6.10-register-console-devname. > > > > > > > > I am not sure about the mainline. We need to fix the regression in 6.10. > > > > The change is not trivial and rc5 is knocking on the doors. > > > > > > > > Unfortunately, the patchset intermixes reverts and new code. > > > > So that it can't be used for simple revert as is. > > > > > > > > I am quite confident that the new code works as expected. > > > > It changes tricky code but the logic of the change is quite > > > > straightforward. > > > > > > > > > > > > I see three solutions: > > > > > > > > 1. Linus could merge the changes directly into rc5. > > > > > > > > 2. I could send a pull request after it survives few days in > > > > linux-next. > > > > > > > > 3. Or we rework the patchset. And do pure revert for 6.10 and > > > > add the feature a clean way for-6.11. > > > > > > Pure revert for 6.10 might be good, as it's late in the cycle. Let me > > > know the git ids and I can do that. > > > > Here's the list of git ids to revert: > > > > $ git log --abbrev=12 --pretty=format:"%h (\"%s\")" v6.9..v6.10-rc5 \ > > --author="Tony Lindgren" kernel/printk drivers/tty/ Documentation/admin-guide/ > > b20172ca6bf4 ("serial: core: Fix ifdef for serial base console functions") > > 4547cd76f08a ("serial: 8250: Fix add preferred console for serial8250_isa_init_ports()") > > 5c3a766e9f05 ("Documentation: kernel-parameters: Add DEVNAME:0.0 format for serial ports") > > a8b04cfe7dad ("serial: 8250: Add preferred console in serial8250_isa_init_ports()") > > a0f32e2dd998 ("serial: core: Handle serial console options") > > 787a1cabac01 ("serial: core: Add support for DEVNAME:0.0 style naming for kernel console") > > b73c9cbe4f1f ("printk: Flag register_console() if console is set on command line") > > 8a831c584e6e ("printk: Don't try to parse DEVNAME:0.0 console options") > > f03e8c1060f8 ("printk: Save console options for add_preferred_console_match()") > > All now reverted, thanks! Great, thanks Greg! Tony, could you please send a new patchset which would provide the new solution on top of this revert? It might make sense to wait until the revert reaches mainline. Best Regards, Petr