Message ID | 20230912110350.14482-1-tony@atomide.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp361067vqx; Tue, 12 Sep 2023 05:13:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeyk5OzaX57XBjYRkcJTXYRJpvCL2i9a7d427nxVjyJlcvrx3Q7Mnf5lGksk0y5jHfrMnN X-Received: by 2002:a17:90a:53a2:b0:26d:5ec:12e8 with SMTP id y31-20020a17090a53a200b0026d05ec12e8mr9471305pjh.3.1694520809448; Tue, 12 Sep 2023 05:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694520809; cv=none; d=google.com; s=arc-20160816; b=k6UWJFJGxU6kNWVzAi5OjlQlxCYZNAT+64fda6rSvNTX3DdmFhUZyHmruEosGx0RiQ oZGynLbenaB2Z8613xpzQ4frUWdi7jQ6kNRO5uelQHK6x8S4R8xSWKvzJsGYJU+agI6H L2cTkyphG0uGnuUnddtH4WTciVDy591yXwg0UzGAzRNeP9mm7YXFEvRJy8Ya5dQxVKDn Fx5bLIpNMGaMOtE+4rqo7e/xK+nyt7/hFt4lNGtcX3kpd88rZiKVsUWugrZcHwZzkOLB YMRCRgLAJLV3Mw8MN2N10uSJpokcMbfbb/4emcZRMFhF5PFBTfMCVZ0ePJXrZU43pRJs B4mQ== 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=ozptDIt8zyAzbwcPGE+zm/c3ko7Wn7IpEggwCdjrtEM=; fh=n7dM+f7LjYuLx+o4gzxXNkEWC9u7qeJi6cmcRDZcVew=; b=DA2d38CgJ03hEB6VoXJHRMvv70T6zvYT1hRvcrTZ0uKRClEO/uoz1s49GDZeiVzoqv BGsM53fczkh2MLrYsDjIYVcrWL8Lh4lSBnr2mF0jblGibrZ/4Ry91bKuMbJ7jqjbK3iX GGq8cmTO/a3fSyDxi6yS0XYFZdw30RSiYU2wngOMbxPu81aT7KfOcmWdWpudlpD8ayuj NGbvFxBnuO961nVRLGfOlL+Z0KhleYATVcFmhg4Cm9FUd+CdvNF+CSEuX0nmBmVNgqzo JoMF/ncBwyOv+RDfnUwiORB2AkYNqa000Ux/LKAkvRkK7N5LUnPrao8lWaXY7U+cDDS/ uWGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id gl21-20020a17090b121500b0026349debbdfsi9656126pjb.136.2023.09.12.05.13.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 05:13:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id C615580BD5EF; Tue, 12 Sep 2023 04:05:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.8 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234337AbjILLEy (ORCPT <rfc822;pwkd43@gmail.com> + 37 others); Tue, 12 Sep 2023 07:04:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234554AbjILLEW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 12 Sep 2023 07:04:22 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 027C810DE; Tue, 12 Sep 2023 04:04:09 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 5F15F80FC; Tue, 12 Sep 2023 11:04:07 +0000 (UTC) From: Tony Lindgren <tony@atomide.com> To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org> Cc: Andy Shevchenko <andriy.shevchenko@intel.com>, Dhruva Gole <d-gole@ti.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, John Ogness <john.ogness@linutronix.de>, Johan Hovold <johan@kernel.org>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, Vignesh Raghavendra <vigneshr@ti.com>, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2 0/3] Add support for DEVNAME:0.0 style hardware based addressing Date: Tue, 12 Sep 2023 14:03:42 +0300 Message-ID: <20230912110350.14482-1-tony@atomide.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 12 Sep 2023 04:05:19 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776833851811893933 X-GMAIL-MSGID: 1776833851811893933 |
Series |
Add support for DEVNAME:0.0 style hardware based addressing
|
|
Message
Tony Lindgren
Sept. 12, 2023, 11:03 a.m. UTC
Hi all, With the recent serial core changes in v6.5, 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. With these changes the port mapping is visible for usespace in sysfs with: $ grep DEVNAME /sys/bus/serial-base/devices/*/tty/uevent Regards, Tony 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: Constify name for add_preferred_console() serial: core: Add support for DEVNAME:0.0 style naming for kernel console serial: core: Add sysfs links for serial core port instances for ttys drivers/tty/serial/Makefile | 3 + drivers/tty/serial/serial_base.h | 11 +++ drivers/tty/serial/serial_base_con.c | 133 +++++++++++++++++++++++++++ drivers/tty/serial/serial_core.c | 26 ++++++ include/linux/console.h | 2 +- kernel/printk/printk.c | 4 +- 6 files changed, 176 insertions(+), 3 deletions(-) create mode 100644 drivers/tty/serial/serial_base_con.c base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c