Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp311212rdf; Tue, 21 Nov 2023 03:33:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjkIZPDRlgcQixkoBeVVgTLX2BemWP+NgkzfWnF+q02mOK6XhvE1mLUomsr2AYyrydZgvP X-Received: by 2002:a17:90b:3ec4:b0:27d:20ca:1156 with SMTP id rm4-20020a17090b3ec400b0027d20ca1156mr7889001pjb.34.1700566380479; Tue, 21 Nov 2023 03:33:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700566380; cv=none; d=google.com; s=arc-20160816; b=F+wZv1sbqOs0HJFWcNW5uQVoyqgzJbgv7fTC3rMDfa+VHQFQsUY1rDOA4I8spOKNn7 BZV5fPz1s2dfg6tpL2tRf52wIi7ZWbbxypO2pCfaJsz7pWiaUeXAgOs5vCgdzenMISli +jwA2cQiO0WuIvEHSnU98cbRiBkCoHHYB4V+Hu5zJy/BFIeixovAU4dcPfg0Fi5OukQW oL+10SlD7Wq6VZi7LfznLjxEjJnIEnSPNJzJFzGZ+QgAcvmuk8kJNeAhzKFTJBIn27SC rdmn3z89pFNppkrvusRbed98+y7GYywoBknFN4nrm+SauLIH3jf51SxX2p3xmyu7mAUt dTLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=FlsDs8QRFBtwAUChWEGGUlLJ5XmLc9SS6VuGxIw1WU4=; fh=bWj5KacFiXVp0Il3xL1MvNC9F4GPhzCV51seXUkiNOA=; b=H/nOFd5vXqzyKhg19rnVoGRIRV2S8EW+2zVpWxmvaFWbNQYdTCNYZ1bykZmaWi2QIz 0z91ctp5g5YGmUS4iAh3JP1I19nk8GR1gPnDMm+vsG0cSS7/vZ1YFFQWU3OGzKAR45fg cBdlRM8jg+3gzO9nBULbGI6fFK2T+JY2GgbD0gOjCffTVntTxU6GlfQon2ZiUfnUTrVh L+n3w7uq7rr3zc/KRc2uut8RnZlh2YnbdROttCtgIcoJgtzc8oeXQBDDRkZoejSyulzt RUAlAaEGUeqtqgVxdLkZOPh52Yd5RD++sBi08fkZIRF2M6AaDCZ0RNhUlmpygQqSpCL+ 6AKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id q14-20020a17090ac10e00b00274e16f797csi10661873pjt.20.2023.11.21.03.33.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 03:33:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2AE0580A0DEA; Tue, 21 Nov 2023 03:32:56 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233753AbjKULct (ORCPT + 99 others); Tue, 21 Nov 2023 06:32:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjKULcr (ORCPT ); Tue, 21 Nov 2023 06:32:47 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 761C19C; Tue, 21 Nov 2023 03:32:43 -0800 (PST) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id F3A6C80CC; Tue, 21 Nov 2023 11:32:39 +0000 (UTC) From: Tony Lindgren To: Greg Kroah-Hartman , Jiri Slaby Cc: "David S . Miller" , Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Andy Shevchenko , Dhruva Gole , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v3 0/3] Add support for DEVNAME:0.0 style hardware based addressing Date: Tue, 21 Nov 2023 13:31:54 +0200 Message-ID: <20231121113203.61341-1-tony@atomide.com> X-Mailer: git-send-email 2.42.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 03:32:56 -0800 (PST) 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. This also allows us to also drop the old console_setup() parsing for character device names. Regards, Tony 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 (3): printk: Save console options for add_preferred_console_match() serial: core: Add support for DEVNAME:0.0 style naming for kernel console serial: core: Move console character device handling from printk drivers/tty/serial/serial_base.h | 14 ++++ drivers/tty/serial/serial_base_bus.c | 104 ++++++++++++++++++++++++ drivers/tty/serial/serial_core.c | 4 + include/linux/printk.h | 3 + kernel/printk/Makefile | 2 +- kernel/printk/conopt.c | 115 +++++++++++++++++++++++++++ kernel/printk/console_cmdline.h | 4 + kernel/printk/printk.c | 41 +++------- 8 files changed, 254 insertions(+), 33 deletions(-) create mode 100644 kernel/printk/conopt.c -- 2.42.1