public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Tony Lindgren" <tony.lindgren@linux.intel.com>,
	"Linus Torvalds" <torvalds@linuxfoundation.org>,
	"Jiri Slaby" <jirislaby@kernel.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"John Ogness" <john.ogness@linutronix.de>,
	"Sergey Senozhatsky" <senozhatsky@chromium.org>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Tony Lindgren" <tony@atomide.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 0/4] Fixes for console command line ordering
Date: Tue, 25 Jun 2024 10:36:17 +0200	[thread overview]
Message-ID: <ZnqBYAV7iplmeh1R@pathway.suse.cz> (raw)
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

  reply	other threads:[~2024-06-25  8:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 12:45 [PATCH v4 0/4] Fixes for console command line ordering Tony Lindgren
2024-06-20 12:45 ` [PATCH v4 1/4] printk: Revert add_preferred_console_match() related commits Tony Lindgren
2024-06-20 12:45 ` [PATCH v4 2/4] printk: Add match_devname_and_update_preferred_console() Tony Lindgren
2024-06-20 12:45 ` [PATCH v4 3/4] serial: core: Revert unusable console quirk handling Tony Lindgren
2024-06-21 12:15   ` Petr Mladek
2024-06-20 12:45 ` [PATCH v4 4/4] serial: core: Add serial_base_match_and_update_preferred_console() Tony Lindgren
2024-06-21 12:37   ` Petr Mladek
2024-06-24  7:21     ` Tony Lindgren
2024-06-21 14:44 ` [PATCH v4 0/4] Fixes for console command line ordering Petr Mladek
2024-06-24 13:35   ` Greg Kroah-Hartman
2024-06-25  5:12     ` Tony Lindgren
2024-06-25  6:20       ` Greg Kroah-Hartman
2024-06-25  8:36         ` Petr Mladek [this message]
2024-06-25  9:07           ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZnqBYAV7iplmeh1R@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=tony.lindgren@linux.intel.com \
    --cc=tony@atomide.com \
    --cc=torvalds@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox