From patchwork Tue Dec 5 07:32:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 750684 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=atomide.com header.i=@atomide.com header.b="mfq7qOTQ" Received: from mail5.25mail.st (mail5.25mail.st [74.50.62.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 747A2CB; Mon, 4 Dec 2023 23:33:47 -0800 (PST) Received: from localhost (91-158-86-216.elisa-laajakaista.fi [91.158.86.216]) by mail5.25mail.st (Postfix) with ESMTPSA id 180E860354; Tue, 5 Dec 2023 07:33:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=atomide.com; s=25mailst; t=1701761626; bh=7h5wlzQdpRnMNvGKsqPPaRZvd85tYn+u1pMnFtiPN10=; h=From:To:Cc:Subject:Date:From; b=mfq7qOTQojPAcWlc+l43nDG3ElnzK+UoO/XbCuDC8Lsfc0CvFKnZjXGhhtf6W3nmQ 1DkHSRTW9WM+dZ5Ccn1a0+W/dVz6iKgy0zcCag6WAygvE6/LaOkSYKh+SOWubbNmmp ihes/iJyRU+7+gc4RnL6KWPyLu6PjGkt9cNhvcLY+k3yrbVD0VN0ZIo5AwA/gCbo5U fPbzECjGWgolo38YGoPzcUh1Nkn0j/1jS7IfOgGjo8M31+Cn+p+yqpJxMTaymXhdGJ g7CsRZmJv6PUEDEygd0nDG1dMh15RvZ59OO/D0Hw/UAtF0EUI0k/hhjY7ABvhbBU4H 0TYeBUQY0GC4w== From: Tony Lindgren To: Greg Kroah-Hartman , Jiri Slaby , Petr Mladek , Steven Rostedt , John Ogness , Sergey Senozhatsky Cc: "David S . Miller" , Andy Shevchenko , Dhruva Gole , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v4 0/4] Add support for DEVNAME:0.0 style hardware based addressing Date: Tue, 5 Dec 2023 09:32:32 +0200 Message-ID: <20231205073255.20562-1-tony@atomide.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Hi all, With the recent serial core changes, we can now add DEVNAME:0.0 style addressing for the serial ports. When using DEVNAME:0.0 naming, we don't need to care which ttyS instance number is allocated depending on HSUART settings or if the devicetree has added aliases for all the ports. We also prepare the serial core to handle the ttyS related quirks done in console_setup() to prepare things for eventually dropping the parsing from console_setup(). This can only happen after further changes to register_console(). Regards, Tony Changes since v3: - Fix handling of brl_options by saving them too in console_opt_save() - Drop changes to remove console_setup() parsing, further changes to register_console() are still needed before can leave out the early parsing - Added a patch for serial8250_isa_init_preferred_console(), otherwise the console gets initialized later for x86 when the console_setup() parsing is dropped as pointed out by Petr - Initialize __free() variables to NULL as noted by Dan - Return handled in console_setup() if saving console options fails - Simplify serial_base_add_preferred_console() and add a helper for serial_base_add_one_prefcon() as suggested by Andy - Header include changes to kernel/printk/conopt.c as suggested by Andy Changes since v2: - Console name got constified and already applied as suggested by Ilpo and Andy - Add printk/conopt.c to save console command line options - Add a patch to drop old console_setup() character device name parsing - Use cleanup.h to simplify freeing as suggested by Andy - Use types.h instead of kernel.h as suggested by Andy - Use strcspn() as suggested by Andy - Various coding improvments suggested by Andy Changes since v1: - Constify printk add_preferred_console() as suggested by Jiri - Use proper kernel command line helpers for parsing console as suggested by Jiri - Update description for HSUART based on Andy's comments - Standardize on DEVNAME:0.0 style naming as suggested by Andy - Added missing put_device() calls paired with device_find_child() Tony Lindgren (4): printk: Save console options for add_preferred_console_match() serial: core: Add support for DEVNAME:0.0 style naming for kernel console serial: core: Handle serial console options serial: 8250: Add preferred console in serial8250_isa_init_ports() drivers/tty/serial/8250/8250_core.c | 32 +++++++ drivers/tty/serial/serial_base.h | 14 +++ drivers/tty/serial/serial_base_bus.c | 115 ++++++++++++++++++++++++ drivers/tty/serial/serial_core.c | 4 + include/linux/printk.h | 3 + kernel/printk/Makefile | 2 +- kernel/printk/conopt.c | 128 +++++++++++++++++++++++++++ kernel/printk/console_cmdline.h | 6 ++ kernel/printk/printk.c | 14 ++- 9 files changed, 314 insertions(+), 4 deletions(-) create mode 100644 kernel/printk/conopt.c