From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3896C383987; Thu, 21 May 2026 18:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387422; cv=none; b=gtyRDyF7JHDkvuk1r4iAg42kYz6pIQyDfj/3fpkohK2432ECxQ/kauJBwkn5DzuibtwblC5MY7i2WBQ6qSNEiHrHtXf+GJWuCl2rQqysmLAorZMp6GzXdcffV8V8saRp+II65CP0NFD0GPXgrym3CR6reMLZTdLoAjxj+4qb6To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387422; c=relaxed/simple; bh=NQGPt56E/o5+7zH9da/9d5hBkf8Wne5C/W6JQO+QuQc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DkDKEmnUE+Z467ei3fIkmokEiHxP6pM3dDOQD9kx31ZxEW2RS90Fv6V32uliF5FNacOIuSL1FSLbku/5U9q272aoM/eAO38C3drVom1gCNftiphbkdg+1Yyn/7M8C2xmD5grRimQoeascwP3ApfTpoERaj8yI8mczvyg5xBPekU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=z0dec9jH; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="z0dec9jH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=T44N37CIX5+e9Q7CPVwpyuDmYPlxs4cUhzuBv7EI0PA=; b=z0dec9jHVxnnQE397BlCeAlRqQ LnJiBMD0QIveEczHlC/ORGledRp/ThW5BjeonEC7grOLAfiAs24I3VcQUSoNqydfdRLiAEteE8vO4 mWgCidb3LX2tFkYPD0MeROuGdBM3vVn/q4N2+fohChvkvheeXN5r379CPrnAivLOJX1w=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x4-000000001yA-1mP2; Thu, 21 May 2026 14:16:58 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:47 -0400 Subject: [PATCH v3 01/10] serial: 8250_hub6: add hub6_match_port() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-1-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Move the entire hub6 related match port check into its own function in 8250_hub6.c and add a stub for the case when hub6 code is not even built into kernel. Suggested-by: Ilpo J=C3=A4rvinen Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/8250/8250.h | 7 +++++++ drivers/tty/serial/8250/8250_hub6.c | 6 ++++++ drivers/tty/serial/serial_core.c | 4 ++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 77fe0588fd6bd5c5baac0fa03b7c466742aa9432..9d1068d0489dc4285b1d3048992= 6bd676bcbe60e 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -334,6 +334,13 @@ int fintek_8250_probe(struct uart_8250_port *uart); static inline int fintek_8250_probe(struct uart_8250_port *uart) { return = 0; } #endif =20 +#ifdef CONFIG_SERIAL_8250_HUB6 +bool hub6_match_port(const struct uart_port *port1, const struct uart_port= *port2); +#else +static inline bool hub6_match_port(const struct uart_port *port1, const st= ruct uart_port *port2) +{ return false; } +#endif + #ifdef CONFIG_ARCH_OMAP1 #include static inline int is_omap1_8250(struct uart_8250_port *pt) diff --git a/drivers/tty/serial/8250/8250_hub6.c b/drivers/tty/serial/8250/= 8250_hub6.c index 273f59b9bca555e9fb035005d3df2089c5b0a039..eae32c924e29bcaf608d66988ac= a461b9a53dc91 100644 --- a/drivers/tty/serial/8250/8250_hub6.c +++ b/drivers/tty/serial/8250/8250_hub6.c @@ -41,6 +41,12 @@ static struct platform_device hub6_device =3D { }, }; =20 +bool hub6_match_port(const struct uart_port *port1, const struct uart_port= *port2) +{ + return port1->iobase =3D=3D port2->iobase && port1->hub6 =3D=3D port2->hu= b6; +} +EXPORT_SYMBOL_GPL(hub6_match_port); + static int __init hub6_init(void) { return platform_device_register(&hub6_device); diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index 075a69164aa7c56137a2f3d2245ef3eb1d2285de..05bebf666a5d5ce66a05181c69d= b48e7355fec42 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -33,6 +33,7 @@ #include =20 #include "serial_base.h" +#include "8250/8250.h" /* For hub6_match_port() */ =20 /* * This is used to lock changes in serial line configuration. @@ -3194,8 +3195,7 @@ bool uart_match_port(const struct uart_port *port1, case UPIO_PORT: return port1->iobase =3D=3D port2->iobase; case UPIO_HUB6: - return port1->iobase =3D=3D port2->iobase && - port1->hub6 =3D=3D port2->hub6; + return hub6_match_port(port1, port2); case UPIO_MEM: case UPIO_MEM16: case UPIO_MEM32: --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 388492BDC32; Thu, 21 May 2026 18:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387423; cv=none; b=Hoj7jkWd6C7PJ5gox4cVMXFu2xUdQGb0jEmZ/aMEZTkRL71tFttxDVD1j/AkuC8bCeGTc7Tao8i2MOcMtkM8BD4Enk5OonhT+520j1cAiV5FZFh0bLk5ZhU45mMihusjcl9mTLbuKfhGA7moPJLHs+3+Ia9xMu4H36Cgd3Hci1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387423; c=relaxed/simple; bh=BicLH3tRDoF3lP1EsTOBfbU4fR8vqDcLMqFrMwxShIo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PbgY6Hdc9YsCY8b8hsYGdfSgXUUvGKm5dociF2FheEglJJJ8cnzjWouGSOg0qUjHpqakIVJTOxK8jQzntaRL79B3+ffLZ0IzI2kk81AkHekRbONvVmoWaJwYYt7MUlDJB2l4gJVbNnOHc/+PVf+ob4aCN7WpaEjL62AA+hQ1/+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=GvHi+fsi; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="GvHi+fsi" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=UAamvI1WETGVqN/7G2tuRMQVVb8w1fmlJAQkHLmZN9Y=; b=GvHi+fsiNwri3BkB5QfM3KG+6/ Y3zQNrCvTY6rCjMmcuJ1bx5i2ImCZlPrt6oNIhtCUWHE2tjoIGMnWoyXd6sZZolNyLXAK0wuGTBnM BUNkTjC4Jq2NKrRDW5CWdSOTibmV/GRJ9j43aetXWsYvK1tWrVMjdrhWlZhnMwc06Yyg=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x4-000000001yA-3cs1; Thu, 21 May 2026 14:16:59 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:48 -0400 Subject: [PATCH v3 02/10] serial: core: add uart_iotype_mmio/io helper functions 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-2-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve To help simplify code that check on the io type mode of the port. Signed-off-by: Hugo Villeneuve --- Will also be used by future commit that add UPIO_BUS. --- drivers/tty/serial/serial_core.c | 28 ++++++++++++++++++++++++++++ include/linux/serial_core.h | 4 ++++ 2 files changed, 32 insertions(+) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index 05bebf666a5d5ce66a05181c69db48e7355fec42..7a29f17814641f085b37e9b9cc5= 227e2a249aaa9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1963,6 +1963,34 @@ static const char *uart_type(struct uart_port *port) return str; } =20 +bool uart_iotype_mmio(enum uart_iotype iotype) +{ + switch (iotype) { + case UPIO_MEM: + case UPIO_MEM32: + case UPIO_AU: + case UPIO_TSI: + case UPIO_MEM32BE: + case UPIO_MEM16: + return true; + default: + return false; + } +} +EXPORT_SYMBOL_GPL(uart_iotype_mmio); + +bool uart_iotype_io(enum uart_iotype iotype) +{ + switch (iotype) { + case UPIO_PORT: + case UPIO_HUB6: + return true; + default: + return false; + } +} +EXPORT_SYMBOL_GPL(uart_iotype_io); + #ifdef CONFIG_PROC_FS =20 static void uart_line_info(struct seq_file *m, struct uart_state *state) diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 4f7bbdd90017602ba72b8a67e077922feeec95da..a06da6b24c1ad48afffa1e35537= 7992aec0debff 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -1318,4 +1318,8 @@ static inline int uart_handle_break(struct uart_port = *port) !((cflag) & CLOCAL)) =20 int uart_get_rs485_mode(struct uart_port *port); + +bool uart_iotype_mmio(enum uart_iotype iotype); +bool uart_iotype_io(enum uart_iotype iotype); + #endif /* LINUX_SERIAL_CORE_H */ --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB3D2390603; Thu, 21 May 2026 18:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387423; cv=none; b=srkJbKcn4qPSFMJdsz8N8sOdWIh8c2XIIyaNahclqG4gys0F91+F2do0+iHTj7QE63CL7TULO9IP+9NuM5ixdcZNl92LNEy1iuZnoVojsKXXIjTiuqzaZOHaohM3xAtCdq+F/SLF0MqKWDU2IdUhgD/BcOPHszxbqbRXGlF7zDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387423; c=relaxed/simple; bh=5iCG+PyHFrpKEGp+55YcNnA4lwF5tKz+xc9+d4l6Pb4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PQxummjNcqy5CN99nrE49HhY5rQuWspX92BCPODCRCF/PnHqgHYTKensPwUxblqgEzak5ci1MdhzO3LJct1Ck1SaY4bgVE4yOzp3742JbHPnHftj5ZM70n/1V7ZUQ9gcL8l9fASmoUv0fqvYuqA2+YL7hNp1E2NFq3BnXEzxYYU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=Z1Z27fke; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="Z1Z27fke" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=ReAjWItx4B5vt5013uQRiM57/Z3EWQ3eEakVlyH8+Ic=; b=Z1Z27fkeW3NACgOILgzJ1GMgcZ VmPbW1GDwxbtlGIECQDZNaxXdPxGH0y0vX7GJdP1UhXN5uh4NAoKlFCD1LZBQUYlXwo8Sku7+q/na LxzFJFDlS/laTF3Zx5bBYJ0+eOVxtcD31zuJCKivEkcOq6W1fEFDYlWtgWKammqRiRAY=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x5-000000001yA-1b9L; Thu, 21 May 2026 14:16:59 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:49 -0400 Subject: [PATCH v3 03/10] serial: core: use uart_iotype_*() to simplify uart_match_port() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-3-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Make use of new functions uart_iotype_mmio() and uart_iotype_legacy_io() to simplify and improve code readability. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/serial_core.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index 7a29f17814641f085b37e9b9cc5227e2a249aaa9..432281c96f80ce3be317e3f5332= 4923292b3eb44 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3218,22 +3218,14 @@ bool uart_match_port(const struct uart_port *port1, { if (port1->iotype !=3D port2->iotype) return false; - - switch (port1->iotype) { - case UPIO_PORT: + else if (port1->iotype =3D=3D UPIO_PORT) return port1->iobase =3D=3D port2->iobase; - case UPIO_HUB6: + else if (port1->iotype =3D=3D UPIO_HUB6) return hub6_match_port(port1, port2); - case UPIO_MEM: - case UPIO_MEM16: - case UPIO_MEM32: - case UPIO_MEM32BE: - case UPIO_AU: - case UPIO_TSI: + else if (uart_iotype_mmio(port1->iotype)) return port1->mapbase =3D=3D port2->mapbase; - default: + else return false; - } } EXPORT_SYMBOL(uart_match_port); =20 --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A2BD392C24; Thu, 21 May 2026 18:17:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387427; cv=none; b=oBT68j9W2syBEoyZDxakoeyQlFWeVqECmfchMx5Zdab2eFWe1z3sTbL7zmrKw1gvvNooo2RmLzdta8+jsEwIEYO9TJSv0vUkt6PcWE/fd2XEGmfGCH/ktK3p2aV7WOaXid5eUaBbHPM7r3/Q7gBOOgEN+jMU50X7BMdk+GEqlBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387427; c=relaxed/simple; bh=xAfxlgIZOmXbsfxkWwWdKSvtGRKGkB/k3Yw4+WVTV+8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ojN4vDJKkXrCEsZZd8EKGQnZn3gm9gvm9sjFIzcZPpsvkXBYj/ohFa2oTD9DCVsIOFIzBqIcpS07DmY3PUUZVfnRpPBpTDTEVG21wVkybXbIW6rkPApULf5xLl+Vni7QSL65IPSe+VmBbEdtoKlUDUR0ICrIRZWC538OaZOv4hI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=P+RNspkt; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="P+RNspkt" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=JSlVFx7yAh0ri4eqZWT3jRqu7SdSqmFuII1RYG3NWtI=; b=P+RNspkt7ovMcYHiNdp5x3b6A4 JzsxRVTjtrK/0feHV72ZbntTxxmqpsy6mK4LcmZliHOUUglvNAD1F3JClN//W6lqlXjiPYWYeGpDI 2Sg0s23lfgRV7zeCCcI2DK68PvYY9/8q9Xlr3M2oFx+8BIhh97gstDioA4mmZ43xszgA=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x6-000000001yA-0b3U; Thu, 21 May 2026 14:17:00 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:50 -0400 Subject: [PATCH v3 04/10] serial: uniformize serial port I/O infos display 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-4-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Uniformize serial port I/O infos display from three different functions that display mostly the same information, but with some variations, by adding a common function. This make use of new functions uart_iotype_mmio() and uart_iotype_legacy_io() to simplify and improve code readability. This will prevent displaying irrelevant information for future IO types (ex: UPIO_BUS), while also addressing the (eventually) invalid check for "iotype >=3D UPIO_MEM". This also allows us to remove the confusing cast to (unsigned long long) for iobase which is defined as an unsigned long, and use %pa to display the mapbase pointer, as it is done in earlycon_print_info(). Replace snprintf with more robust scnprintf so we could perhaps one day get rid of snprintf() entirely. Signed-off-by: Hugo Villeneuve --- On 32-bit cpu: no changes. On 64-bit cpu: # cat /proc/tty/driver/sci before serinfo:1.0 driver revision: 0: uart:scif mmio:0x1004B800 irq:35 tx:11192 rx:37 RTS|CTS|DTR|DSR|CD after: serinfo:1.0 driver revision: 0: uart:scif mmio:0x000000001004b800 irq:35 tx:11339 rx:35 RTS|CTS|DTR|= DSR|CD Using uart_iotype_mmio() now includes the case for UPIO_TSI and UPIO_AU, which fell before this patch in the else clause. UPIO_TSI is no longer used by any driver, so not an issue. UPIO_AU, if this is even possible for earlycon, falls into the "MMIO" categ= ory in uart_line_info() and uart_report_port()... Maybe the width information could be dropped entirely? --- drivers/tty/serial/earlycon.c | 17 +++------ drivers/tty/serial/serial_core.c | 76 ++++++++++++++++++++++--------------= ---- include/linux/serial_core.h | 1 + 3 files changed, 47 insertions(+), 47 deletions(-) diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index ab9af37f6cda35ea2e3ea966fdac8ba5c4475cb2..ce740cdc7cebffca0b4f6be98b8= bca66540af72d 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c @@ -75,19 +75,12 @@ static void __init earlycon_print_info(struct earlycon_= device *device) { struct console *earlycon =3D device->con; struct uart_port *port =3D &device->port; + char ioinfos[64]; =20 - if (port->iotype =3D=3D UPIO_MEM || port->iotype =3D=3D UPIO_MEM16 || - port->iotype =3D=3D UPIO_MEM32 || port->iotype =3D=3D UPIO_MEM32BE) - pr_info("%s%d at MMIO%s %pa (options '%s')\n", - earlycon->name, earlycon->index, - (port->iotype =3D=3D UPIO_MEM) ? "" : - (port->iotype =3D=3D UPIO_MEM16) ? "16" : - (port->iotype =3D=3D UPIO_MEM32) ? "32" : "32be", - &port->mapbase, device->options); - else - pr_info("%s%d at I/O port 0x%lx (options '%s')\n", - earlycon->name, earlycon->index, - port->iobase, device->options); + uart_get_ioinfos(port, ioinfos, sizeof(ioinfos)); + + pr_info("%s%d%s (options '%s')\n", earlycon->name, earlycon->index, + ioinfos, device->options); } =20 static int __init parse_options(struct earlycon_device *device, char *opti= ons) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index 432281c96f80ce3be317e3f53324923292b3eb44..afc7c1421ad54aeb7492bbda670= 939498b9018fc 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1998,9 +1998,9 @@ static void uart_line_info(struct seq_file *m, struct= uart_state *state) struct tty_port *port =3D &state->port; enum uart_pm_state pm_state; struct uart_port *uport; + char ioinfos[64]; char stat_buf[32]; unsigned int status; - int mmio; =20 guard(mutex)(&port->mutex); =20 @@ -2008,13 +2008,10 @@ static void uart_line_info(struct seq_file *m, stru= ct uart_state *state) if (!uport) return; =20 - mmio =3D uport->iotype >=3D UPIO_MEM; - seq_printf(m, "%u: uart:%s %s%08llX irq:%u", - uport->line, uart_type(uport), - mmio ? "mmio:0x" : "port:", - mmio ? (unsigned long long)uport->mapbase - : (unsigned long long)uport->iobase, - uport->irq); + seq_printf(m, "%u: uart:%s", uport->line, uart_type(uport)); + uart_get_ioinfos(uport, ioinfos, sizeof(ioinfos)); + seq_printf(m, "%s", ioinfos); + seq_printf(m, " irq:%u", uport->irq); =20 if (uport->type =3D=3D PORT_UNKNOWN) { seq_putc(m, '\n'); @@ -2476,38 +2473,47 @@ int uart_resume_port(struct uart_driver *drv, struc= t uart_port *uport) } EXPORT_SYMBOL(uart_resume_port); =20 +static const char *uart_get_mmio_width(struct uart_port *port) +{ + switch (port->iotype) { + case UPIO_MEM16: + return "16"; + case UPIO_MEM32: + case UPIO_MEM32BE: + return "32be"; + case UPIO_AU: + case UPIO_MEM: + default: + return ""; + } +} + +void uart_get_ioinfos(struct uart_port *port, char *buf, size_t size) +{ + buf[0] =3D '\0'; + + if (uart_iotype_mmio(port->iotype)) { + scnprintf(buf, size, " MMIO%s:%pa", uart_get_mmio_width(port), &port->ma= pbase); + } else if (uart_iotype_io(port->iotype)) { + if (port->iotype =3D=3D UPIO_PORT) + scnprintf(buf, size, " I/O:0x%lx", port->iobase); + else if (port->iotype =3D=3D UPIO_HUB6) + scnprintf(buf, size, " I/O:0x%lx, offset 0x%x", port->iobase, port->hub= 6); + } +} +EXPORT_SYMBOL(uart_get_ioinfos); + static inline void uart_report_port(struct uart_driver *drv, struct uart_port *port) { - char address[64]; + char ioinfos[64]; =20 - switch (port->iotype) { - case UPIO_PORT: - snprintf(address, sizeof(address), "I/O 0x%lx", port->iobase); - break; - case UPIO_HUB6: - snprintf(address, sizeof(address), - "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); - break; - case UPIO_MEM: - case UPIO_MEM16: - case UPIO_MEM32: - case UPIO_MEM32BE: - case UPIO_AU: - case UPIO_TSI: - snprintf(address, sizeof(address), - "MMIO 0x%llx", (unsigned long long)port->mapbase); - break; - default: - strscpy(address, "*unknown*", sizeof(address)); - break; - } + uart_get_ioinfos(port, ioinfos, sizeof(ioinfos)); =20 - pr_info("%s%s%s at %s (irq =3D %u, base_baud =3D %u) is a %s\n", - port->dev ? dev_name(port->dev) : "", - port->dev ? ": " : "", - port->name, - address, port->irq, port->uartclk / 16, uart_type(port)); + pr_info("%s%s%s%s (irq =3D %u, base_baud =3D %u) is a %s\n", + port->dev ? dev_name(port->dev) : "", + port->dev ? ": " : "", + port->name, ioinfos, port->irq, port->uartclk / 16, uart_type(port)); =20 /* The magic multiplier feature is a bit obscure, so report it too. */ if (port->flags & UPF_MAGIC_MULTIPLIER) diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index a06da6b24c1ad48afffa1e355377992aec0debff..b91ad22be11b0d0b82928b9277c= f29807796830e 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -1319,6 +1319,7 @@ static inline int uart_handle_break(struct uart_port = *port) =20 int uart_get_rs485_mode(struct uart_port *port); =20 +void uart_get_ioinfos(struct uart_port *port, char *buf, size_t size); bool uart_iotype_mmio(enum uart_iotype iotype); bool uart_iotype_io(enum uart_iotype iotype); =20 --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 604C43911D6; Thu, 21 May 2026 18:17:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387429; cv=none; b=sibOCbuYltULh29VGNHXa20EwI79R3C4kHLOAmFWCJqmJY0Xspn2Fl96tOheM0vaGXRBtsYW2XLBgWFxrbn49VwGO6diSZmVdMuyiTqCpAk+ViBjMYCqsVRYH/bnEYJszHgAg7ms61kgEiKdeT74CXAF6e3IcucMzojlNvqgfNw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387429; c=relaxed/simple; bh=iLToBsHpSohULFc0EP+qWYer9ijRiHwJ3pqwmHWsAZQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KD9pwZoFpbmIPgFacioc33XFmqePvr6uW1DiJm/H6hSg5tx8hni9kzy54yFs2/5np6MSx3D3d/kQvclaL+dM/Y1gt2fEm1lfVXw+v/hG827x+upJpF4GlZABT7oWcWPV3DxdE+tdfFlk7ZOl3//hw7szVgym0VvG2iGolNx91BE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=j8LOtY+j; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="j8LOtY+j" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=HDad8tre8cgLM6lKAS7gv2w3ffbeq2s30zMYuiKT/gM=; b=j8LOtY+j3BdxUyRw+a8xmzZ4Up lvYy9vDabmgHWdoK4cLbiCXAGKs1VKArOI/zGOCFq+J3qFYR74zP8HeD1sOPAkt3IgfFY2JyQa3Il dmDtPsoBr7CNGQHzEC0DhW0ovYkchGzo/w30Qaj+K9roensbDBpN+K/+aEC9c/L5Pjf0=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x6-000000001yA-49S1; Thu, 21 May 2026 14:17:01 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:51 -0400 Subject: [PATCH v3 05/10] serial: 8250: use uart_iotype_*() to simplify code 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-5-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Make use of new functions uart_iotype_mmio() and uart_iotype_legacy_io() to simplify and improve code readability. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/8250/8250_port.c | 43 ++++++---------------------------= ---- 1 file changed, 7 insertions(+), 36 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/= 8250_port.c index e4e6a53ebea39c376162690219347c1d2729c349..b36341c53f29025fec8787d3446= ca95b27d60fea 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -474,16 +474,10 @@ static void set_io_from_upio(struct uart_port *p) static void serial_port_out_sync(struct uart_port *p, int offset, int value) { - switch (p->iotype) { - case UPIO_MEM: - case UPIO_MEM16: - case UPIO_MEM32: - case UPIO_MEM32BE: - case UPIO_AU: + if (uart_iotype_mmio(p->iotype)) { p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ - break; - default: + } else { p->serial_out(p, offset, value); } } @@ -2865,13 +2859,7 @@ static int serial8250_request_std_resource(struct ua= rt_8250_port *up) unsigned int size =3D serial8250_port_size(up); struct uart_port *port =3D &up->port; =20 - switch (port->iotype) { - case UPIO_AU: - case UPIO_TSI: - case UPIO_MEM32: - case UPIO_MEM32BE: - case UPIO_MEM16: - case UPIO_MEM: + if (uart_iotype_mmio(port->iotype)) { if (!port->mapbase) return -EINVAL; =20 @@ -2885,14 +2873,9 @@ static int serial8250_request_std_resource(struct ua= rt_8250_port *up) return -ENOMEM; } } - return 0; - case UPIO_HUB6: - case UPIO_PORT: + } else if (uart_iotype_io(port->iotype)) { if (!request_region(port->iobase, size, "serial")) return -EBUSY; - return 0; - case UPIO_UNKNOWN: - break; } =20 return 0; @@ -2903,15 +2886,9 @@ static void serial8250_release_std_resource(struct u= art_8250_port *up) unsigned int size =3D serial8250_port_size(up); struct uart_port *port =3D &up->port; =20 - switch (port->iotype) { - case UPIO_AU: - case UPIO_TSI: - case UPIO_MEM32: - case UPIO_MEM32BE: - case UPIO_MEM16: - case UPIO_MEM: + if (uart_iotype_mmio(port->iotype)) { if (!port->mapbase) - break; + return; =20 if (port->flags & UPF_IOREMAP) { iounmap(port->membase); @@ -2919,14 +2896,8 @@ static void serial8250_release_std_resource(struct u= art_8250_port *up) } =20 release_mem_region(port->mapbase, size); - break; - - case UPIO_HUB6: - case UPIO_PORT: + } else if (uart_iotype_io(port->iotype)) { release_region(port->iobase, size); - break; - case UPIO_UNKNOWN: - break; } } =20 --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBD5B3C342B; Thu, 21 May 2026 18:17:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387430; cv=none; b=FaR2/Y9Ho9LIHaqqw8IjIyv6z6ZFzHOuUEE0C6IchQU7R37MDKM56W6XbAgKnpsk1aq9U7/WzNbRV4dM4o83kAP7hwK3iqlsBZ9+vitb/+ygUuV015LPjNVBQo5mF94wD+ZazAE9Vj8/I1VXxUMvd9Hd8zOD6Febai0o6ReHuyA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387430; c=relaxed/simple; bh=E9e1Yqrrnnpe3+dDHZNvFehP1OfM/mxITrGq5WxusfQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mBfTcry1LlXVKedOQd6wHVWoUa3iaSkH3RrOPFuryeLz1FxxbDDjvG18zz6eYTYNC+z880eTQZ5kBASIsH4RDgnrSTAJO4PYNwkxoill3gTJtJzQn01oYPsJdgDVB4HA/c2FerF0Pb9l2j6lVrfQoL18804MdcrZisBDSqo/qyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=gwTCZVMv; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="gwTCZVMv" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=yeSaF9njE5GuFf1Tu4uSm5WErkZGfD4UUUQSnZJxD34=; b=gwTCZVMvoZmC5Ljiqa838LtUYe Ng5R5k6apFu6IDdnFhplBfek4Wb5oJG1mCXks0Kc/nKZqmsEwLe8+qbbn+bccugilTwyhuwPxQrHY 256/RUnt/89wBN4oFWn0/NroShiRqaCH+6D6AQEvYuWE4KJjOWOl0vQGhgzn+7evexjg=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x7-000000001yA-2olS; Thu, 21 May 2026 14:17:02 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:52 -0400 Subject: [PATCH v3 06/10] serial: 8250_rsa: use uart_iotype_*() to simplify code 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-6-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Make use of new functions uart_iotype_mmio() and uart_iotype_legacy_io() to simplify and improve code readability, as well as avoid some variables init if the iotype is not valid. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/8250/8250_rsa.c | 40 ++++++++++++++++++----------------= ---- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/drivers/tty/serial/8250/8250_rsa.c b/drivers/tty/serial/8250/8= 250_rsa.c index fff9395948e33be6b08355bace70275b7515b608..da971437e89c16f718cab71c0d6= 4acd61ed9c436 100644 --- a/drivers/tty/serial/8250/8250_rsa.c +++ b/drivers/tty/serial/8250/8250_rsa.c @@ -19,35 +19,33 @@ static const struct uart_ops *core_port_base_ops; static int rsa8250_request_resource(struct uart_8250_port *up) { struct uart_port *port =3D &up->port; - unsigned long start =3D UART_RSA_BASE << port->regshift; - unsigned int size =3D 8 << port->regshift; + unsigned long start; + unsigned int size; =20 - switch (port->iotype) { - case UPIO_HUB6: - case UPIO_PORT: - start +=3D port->iobase; - if (!request_region(start, size, "serial-rsa")) - return -EBUSY; - return 0; - default: + if (!uart_iotype_io(port->iotype)) return -EINVAL; - } + + start =3D UART_RSA_BASE << port->regshift; + start +=3D port->iobase; + size =3D 8 << port->regshift; + + if (!request_region(start, size, "serial-rsa")) + return -EBUSY; + return 0; } =20 static void rsa8250_release_resource(struct uart_8250_port *up) { struct uart_port *port =3D &up->port; - unsigned long offset =3D UART_RSA_BASE << port->regshift; - unsigned int size =3D 8 << port->regshift; + unsigned long offset; + unsigned int size; =20 - switch (port->iotype) { - case UPIO_HUB6: - case UPIO_PORT: - release_region(port->iobase + offset, size); - break; - default: - break; - } + if (!uart_iotype_io(port->iotype)) + return; + + offset =3D UART_RSA_BASE << port->regshift; + size =3D 8 << port->regshift; + release_region(port->iobase + offset, size); } =20 static void univ8250_config_port(struct uart_port *port, int flags) --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 408CE3911BD; Thu, 21 May 2026 18:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387431; cv=none; b=vD7h3524qIdrneXV2RvP5FuvhpMzE8K6mm1ikwpI9HcrAdI3vaB2PvaBjvfSxSnOU/jpJDSLzwfvHH0O9osgZqBHKObJmP8U4+roqldNKFo2ShlQ9/ItpLMQm9gMYmTnM3bMqX/TujeUevqZ9farhCfckkrpNx+X2y4VigFCHRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387431; c=relaxed/simple; bh=TjDNWcVBCUPRVEFLQGDCq/qcNQAmSS9j003mYviOArI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NxLAGrgXoOESiHfoIF6vdjuISpNxnH8VRbUQ0eO5dZJu0LMJBZ0gKEL+cHsA1/laJYCuhpOYz55nkdEn5vaRgY4uxaXJIkMVPvZNePZwF4ST1W9VM7Cw9LtpJsEu7JDHEYOr0r/cZqmfcy4L93xFVG7pjnH7iUU1InQMoCRPcGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=QpgMORXf; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="QpgMORXf" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=X+F1iyvj77IQke+x5blxIkQHiWoRxpDO8vlmjn6Yu4U=; b=QpgMORXfOhWyEmmue0AGzHGU+9 J65RCA3hqU+w6SOuYbav5vQyWt7j4U7t0Nuxh+vtMQnlgpujAj4nIAlohsSOzksNiJh/spLpZf+Ko al5pMLX/ZQc6aGELJxwFgM7uAVEQr5wvZi6Pn+dcIi+n/gySqeL21uFq6CPjN/r6uQLg=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x8-000000001yA-1VnX; Thu, 21 May 2026 14:17:02 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:53 -0400 Subject: [PATCH v3 07/10] serial: core: add new I/O type for SPI and I2C bus devices 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-7-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve I2C/SPI serial drivers don't use the following struct uart_port variables: port->membase port->mapbase port->iobase However, they are forced to set membase to a non-zero value so that uart_configure_port() will succeed because of the following check: /* If there isn't a port here, don't do anything further. */ if (!port->iobase && !port->mapbase && !port->membase) return; Add a new I/O type for SPI and I2C bus devices to remove the need to implement the kind of above-mentioned ambiguous workarounds to make them work. Now that UART report functions are using uart_iotype_*() functions, no more irrelevant I/O information are being printed for UPIO_BUS iotypes. Signed-off-by: Hugo Villeneuve --- With this change, uart_match_port() will always return true for UPIO_BUS types, and this function is not used by any of the SPI/I2C drivers. --- drivers/tty/serial/serial_core.c | 11 ++++++----- include/linux/serial_core.h | 1 + include/uapi/linux/serial.h | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index afc7c1421ad54aeb7492bbda670939498b9018fc..efc85c7762ebaa543e4c5d3efa6= 51c302a6542ea 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2530,11 +2530,10 @@ uart_configure_port(struct uart_driver *drv, struct= uart_state *state, { unsigned int flags; =20 - /* - * If there isn't a port here, don't do anything further. - */ - if (!port->iobase && !port->mapbase && !port->membase) - return; + /* If there isn't a port here, don't do anything further. */ + if (uart_iotype_mmio(port->iotype) || uart_iotype_io(port->iotype)) + if (!port->iobase && !port->mapbase && !port->membase) + return; =20 /* * Now do the auto configuration stuff. Note that config_port @@ -3230,6 +3229,8 @@ bool uart_match_port(const struct uart_port *port1, return hub6_match_port(port1, port2); else if (uart_iotype_mmio(port1->iotype)) return port1->mapbase =3D=3D port2->mapbase; + else if (port1->iotype =3D=3D UPIO_BUS) + return true; else return false; } diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index b91ad22be11b0d0b82928b9277cf29807796830e..de179b51777bd1b173f6b3633da= 3435e40bb9ccb 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -437,6 +437,7 @@ enum uart_iotype { UPIO_TSI =3D SERIAL_IO_TSI, /* Tsi108/109 type IO */ UPIO_MEM32BE =3D SERIAL_IO_MEM32BE, /* 32b big endian */ UPIO_MEM16 =3D SERIAL_IO_MEM16, /* 16b little endian */ + UPIO_BUS =3D SERIAL_IO_BUS, /* Serial bus I/O access (ex: SPI, I2C) */ }; =20 struct uart_port { diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h index de9b4733607e6b61b08ff7089ff90070168ff4a2..e6f61538fc2837a264d27942afa= af3f12e743445 100644 --- a/include/uapi/linux/serial.h +++ b/include/uapi/linux/serial.h @@ -72,6 +72,7 @@ struct serial_struct { #define SERIAL_IO_TSI 5 #define SERIAL_IO_MEM32BE 6 #define SERIAL_IO_MEM16 7 +#define SERIAL_IO_BUS 8 =20 #define UART_CLEAR_FIFO 0x01 #define UART_USE_FIFO 0x02 --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E5E03911AB; Thu, 21 May 2026 18:17:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387429; cv=none; b=Ibp9q5Q4Rf02JHnr/pym//eNsnRPLbjRpgYsjowL6k4EQaS+RQHRqGM0v+HIjs9qReTXZgvjo/0ZZCRv4lWLfohYpBzYZgjnQGewRkkkiHE77MLNJO/HaHZbgbu00x85qEw2SFHwPcTWQ6jq82gXaIDYR1k9dhNW8A7fpyvtz3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387429; c=relaxed/simple; bh=LTUpd3TmgtJfdNwrIKLkibUpsbTlF2k8wljPMrLkzgY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ux5QON6baJdj5bfW2jtzQLoXhy+5fWa1AUeFEho1M/FF7irzfUVE0JfARR+9LIBya2iVbHsBzr4A5o44O2uHClKmmQLY0uA5Qj+TfVH+SDaUXeQJhblr8fxi5lbNeOwMYEQ8ieAZZ18QBumHrVNILnn6kr59jEpmguJU7RiDIqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=neeoEL2w; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="neeoEL2w" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=6bJXCPaRHdWGSrG/PwXfrp8LFCOjxN3HY3yqJS4aCtw=; b=neeoEL2wmdxbD3VcIF+oEpgWBr Ii3AQMnjPZTOSpb32P+2dXzqJF8ZeYoSClMzylDjsyqNMX/63ecYTZBsw9HOLbd8M7Q1bocIIfqDe joX1nKVJNt+Ui0Br4LMz2TUX2GbhqR1t+ijkVtstBL5kCFG2NQCnPTTZC3KZ/mSgtFx4=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x9-000000001yA-0HO9; Thu, 21 May 2026 14:17:03 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:54 -0400 Subject: [PATCH v3 08/10] serial: sc16is7xx: use new UPIO_BUS as iotype 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-8-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Now that we have a new UPIO_BUS I/O type, use it to register our serial port and remove ambiguous membase/iobase workaround. Note that commit 5da6b1c079e6 ("sc16is7xx: Set iobase to device index") used the iobase field as an index within the device to allow infering the order through sysfs, but this is no longer needed since commit 1ef2c2df1199 ("serial: core: Fix serial core controller port name to show controller id"). Signed-off-by: Hugo Villeneuve --- This means that displaying iomem_base will now always be zero: cat /sys/class/tty/ttySC0/iomem_base 0x0 cat /sys/class/tty/ttySC1/iomem_base 0x0 ... But the index can be properly displayed with this instead (example with two sc16is7xx devices): $> ls -al /sys/class/tty/ttySC*/device ... /sys/class/tty/ttySC0/device -> ../../../spi1.0:0.0 ... /sys/class/tty/ttySC1/device -> ../../../spi1.0:0.1 ... /sys/class/tty/ttySC2/device -> ../../../spi3.0:0.0 ... /sys/class/tty/ttySC3/device -> ../../../spi3.0:0.1 --- drivers/tty/serial/sc16is7xx.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 1fd64a47341d8263c82fcadd90a4c2e549193e19..4b638e69f36f2d20253d8de31f5= 2ecfe349aa39f 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1472,14 +1472,7 @@ static int sc16is7xx_setup_channel(struct sc16is7xx_= one *one, int i, port->type =3D PORT_SC16IS7XX; port->fifosize =3D SC16IS7XX_FIFO_SIZE; port->flags =3D UPF_FIXED_TYPE | UPF_LOW_LATENCY; - port->iobase =3D i; - /* - * Use all ones as membase to make sure uart_configure_port() in - * serial_core.c does not abort for SPI/I2C devices where the - * membase address is not applicable. - */ - port->membase =3D (void __iomem *)~0; - port->iotype =3D UPIO_PORT; + port->iotype =3D UPIO_BUS; port->rs485_config =3D sc16is7xx_config_rs485; port->rs485_supported =3D sc16is7xx_rs485_supported; port->ops =3D &sc16is7xx_ops; --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B27123C456D; Thu, 21 May 2026 18:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387432; cv=none; b=Fo53ouWbVyTJQgv85nDRN0zoTtdgbuugfu0pA8W/obxKu9/zGHAQVTudywbWKoKM/J4unD7GEtxZ/aZX5maf0OJ0G8pzwlAyy0jAuCt0vPKSGeo6LMAIRCy50yyEWmopzVtQ3UKOKOAhFd1zcBBTZcv/cmKM3j0xq0WEJ25jaDk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387432; c=relaxed/simple; bh=S/NsF+Y4Y/4o1SZppwZAiMwcIw1vC91EvAubmCBvhfY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d599R3UP6pfy+YWre0eVc4b+KVdFjimWgW7V9mO7Y0E9ju6zp+DKj0A7IfNhBan+Eif2fk2/RQRs2vZKtmUZYZky/STWeNGhhouyWJ8Ed2553GVq3keAVZtP77KLDbir7nfWmHdZ7r5AeqFN8lDXfWq8jKh8i6FxPoyFWL5EMZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=LuJm4HWK; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="LuJm4HWK" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=T0OlPy7TqB9wAWBECWcDYOkYn/BSMrIW+IH5VHZocWw=; b=LuJm4HWKSCqF2ohf1xkzQAZUug pgso2QOLkgOjre0gJNdR1soIzbCRsUh8jCMDcMFiOj2F7KbdJLW42ejlk7UjFHanmrvT1y8jyGnhK JIffVnL4Tdo8BtyqoJ0Qe3uQQC1wPxv5pq43HnPD7JKnl5srjOHyd9xO2RJyIbqIolOk=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7x9-000000001yA-2h6b; Thu, 21 May 2026 14:17:03 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:55 -0400 Subject: [PATCH v3 09/10] serial: max310x: use new UPIO_BUS as iotype 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-9-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Now that we have a new UPIO_BUS I/O type, use it to register our serial port and remove obscure membase/iobase workaround. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/max310x.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 9f423b3b4201d0db07bbd7b15934db36249e7620..ae3f25d05e83532cd0736c59ff4= 76af916ab24da 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1405,14 +1405,7 @@ static int max310x_probe(struct device *dev, const s= truct max310x_devtype *devty s->p[i].port.type =3D PORT_MAX310X; s->p[i].port.fifosize =3D MAX310X_FIFO_SIZE; s->p[i].port.flags =3D UPF_FIXED_TYPE | UPF_LOW_LATENCY; - s->p[i].port.iotype =3D UPIO_PORT; - s->p[i].port.iobase =3D i; - /* - * Use all ones as membase to make sure uart_configure_port() in - * serial_core.c does not abort for SPI/I2C devices where the - * membase address is not applicable. - */ - s->p[i].port.membase =3D (void __iomem *)~0; + s->p[i].port.iotype =3D UPIO_BUS; s->p[i].port.uartclk =3D uartclk; s->p[i].port.rs485_config =3D max310x_rs485_config; s->p[i].port.rs485_supported =3D max310x_rs485_supported; --=20 2.47.3 From nobody Sun May 24 19:34:45 2026 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93BEC3E9C26; Thu, 21 May 2026 18:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387433; cv=none; b=j7dHpPef39md+DBEV5RgZM3fV4/Uxb73mti9Rwy7sqcFLSHybYrH+Mq/UwlWFsiSwF4eQJlQ1mWIQV+CX4kStAbSnOKg8MPFqRMoS6uhUWljBIUmBOvuXIQ91UjiZlk8YgaPK3i/iUsbNbl32sK/LLP93EuHHz+ByyD8FVf2wHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779387433; c=relaxed/simple; bh=EJPrKqBxkdjXERiK4cwkc7VD6yOaOR5y0dyDPxd8axY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fZFZ61NciEcy29+jIlaogz55rcqs57aKCRKSqaEu5N/ai+UeBEBng3Cfb+byiFhEQa9I4Z74V83A14omPeOWB2Dd0qEm01xmuUEHhXlO5RSjZQswKAR08S9gKjci3fYFprztOHMxJPzTo8lbAmU8u0pcwZB/PmAP6l7tBCC1r0k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=c0qglzCH; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="c0qglzCH" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=default; h=Cc:To:Message-Id:Content-Transfer-Encoding:MIME-Version: Subject:Date:From:subject:date:message-id:reply-to; bh=nQwpibKU/Kvu4xinmgisjbECDkB88p4i9/qMW2ej3g0=; b=c0qglzCHfB9fZTp4izLM1Cvwju q3mU3shYOZPuglbD+c5bRZhPGUvWK/rKXith+5GDeu5RTbzzE+FKiuhmIGEvnnVfPhOBTbo5V1xrk URzZtf6X0L+L9Hdsnt99IVC8vujAckOBtAF5PhdYYyncUQxlECTknsfJZxaFBDPAwYyE=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168] helo=pettiford.lan) by mail.hugovil.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wQ7xA-000000001yA-0Wx1; Thu, 21 May 2026 14:17:04 -0400 From: Hugo Villeneuve Date: Thu, 21 May 2026 14:16:56 -0400 Subject: [PATCH v3 10/10] serial: max3100: use new UPIO_BUS as iotype 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260521-tty-upio-v3-10-bf74567994a0@dimonoff.com> References: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> In-Reply-To: <20260521-tty-upio-v3-0-bf74567994a0@dimonoff.com> To: Greg Kroah-Hartman , Jiri Slaby Cc: hugo@hugovil.com, ilpo.jarvinen@linux.intel.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve X-Mailer: b4 0.14.2 X-Spam_score: -1.0 X-Spam_bar: - From: Hugo Villeneuve Now that we have a new UPIO_BUS I/O type, use it to register our serial port. This allows the driver to work properly when using DT where membase/iobase are not set. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/max3100.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 475b0a6efce4bec36aa4b94ccff83934dbdf9246..17a2ff410305142798ddbbb22b4= 6f18eadce91aa 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -725,6 +725,7 @@ static int max3100_probe(struct spi_device *spi) max3100s[i]->port.ops =3D &max3100_ops; max3100s[i]->port.flags =3D UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; max3100s[i]->port.line =3D i; + max3100s[i]->port.iotype =3D UPIO_BUS; max3100s[i]->port.type =3D PORT_MAX3100; max3100s[i]->port.dev =3D &spi->dev; =20 --=20 2.47.3