From nobody Wed Jun 17 07:22:58 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 2183C3290C8; Thu, 23 Apr 2026 20:15:15 +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=1776975318; cv=none; b=JQiU3lSVs0FXjomUYJQLbf9zbprNqLFDjxTGYxNyu5HjoWWVzkjATk5+XbfMh/TPqjpgUFruZaBVAN4dK7RGKms28SVM2awkzI6bYEt4/7KcpCboBBbZ3UoN6xhSWmpBmpfva+AlZtb3QaJSaH53Xn7BTkUZONkMrwpIQ+vaC1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975318; c=relaxed/simple; bh=V9uB+lAm3bpYHewGHiNGVsh8TBUikeNMKj4L/U2vLiw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FRKR8IQX4hFrO5Hgg3rg+hz/48IRN1+hX0t17IucekcvYl1MxQcMSO2faH0Ljvpwsui34tW6N/GSmd2m7Astg+rEIeFb7K4lj0HK7tmN3GI5PePXxLqX+9i0i2/U6luL4CIkrdPkVWpLVpCZQ8daefmiV9nK+6T1AOxxi0tSNx4= 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=dq6KyReJ; 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="dq6KyReJ" 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=AWdqm/qQhOGbJHPukefNOG+2wE25q4mEpmJr32atPhA=; b=dq6KyReJ3/4aOhUcPYKWEQU06O dhhRU3aurDKmAWNMsBpwX97qa1I1IICV7ezgR/QpjelqPZGQfq7yocy4kQRsOpWKriYglMpNUzs/l IZIXkl168VXZmomH3Ce/ebdvPXStVb2pCyy7Kx/2UgDsPcZiNjnm8tDybR51N8/qDJs0=; 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 1wG0S3-000000002qN-3mNN; Thu, 23 Apr 2026 16:15:07 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:01 -0400 Subject: [PATCH 1/9] serial: core: add uart_iotype_mmio/legacy_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: <20260423-tty-upio-v1-1-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 89cebdd278410a5a97f3f5ee1b9c171715145067..b1cf45a8fc854cd97e349ff077d= 83b42e3ef8b16 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -1966,6 +1966,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_legacy_io(enum uart_iotype iotype) +{ + switch (iotype) { + case UPIO_PORT: + case UPIO_HUB6: + return true; + default: + return false; + } +} +EXPORT_SYMBOL_GPL(uart_iotype_legacy_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 666430b4789977ae19641442b369eb1c773233f4..fc3f5ebe389658c197ffc105ce4= ac11cacef59bb 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -1306,4 +1306,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_legacy_io(enum uart_iotype iotype); + #endif /* LINUX_SERIAL_CORE_H */ --=20 2.47.3 From nobody Wed Jun 17 07:22:58 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 217233290AF; Thu, 23 Apr 2026 20:15:16 +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=1776975317; cv=none; b=EaeJCK6BgmF4s5OeazNb+5buaEXMwWSvkvwI8wT9Dbb2T1e4tz5XOMEqftVztAb6gZJcNningmbeCunv0srkRMMm2gb0kK61qMdYwLleYnFpGlmN4nB3mDQ6zL4phk6eaxJOtfsiNIh5bk8KIa1ppELquQ5GPMqWpKPBhOnaYcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975317; c=relaxed/simple; bh=v+i0tI1dm1RPHIyDcbLA5aiGXJql1Q5oMYY1n93lGrQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IaEoJJOeRNJYZgVHi2wwNXMwXVJ9Y1fVwgd8RJraNe3hMZ7RsFt+BXmUs0GacoWX/i43kHawn3oaefhfUawi4o04wvzRFFn77u0jUYLnZIx91Wf3HD2336KE1w4O5FNGJZkWw7mFy6X8dDqFwkx0I7MIpEOihk33O9owyLg1US4= 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=zFjtsjmU; 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="zFjtsjmU" 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=2zGs6VL8/UJ/FtDhA+BXRBv2fokUHgT8VrEFQgKv9/s=; b=zFjtsjmU52pffxZ6dCKsbKL16Z d92uuL0jdHeIVSDJXJn8EzGSngcQ0i4a2hBMIKLKQ71GUDZezWe1GCla2KP3vHs49ywCWt//NFZYv 35qjaVI68CEDZgNBmeKELeRG2JwRx+yFQAP/h7cwJiPoGZkZvqfYNDEFi0BKfFYBpVX8=; 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 1wG0S4-000000002qN-1UR4; Thu, 23 Apr 2026 16:15:08 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:02 -0400 Subject: [PATCH 2/9] serial: core: 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: <20260423-tty-upio-v1-2-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index b1cf45a8fc854cd97e349ff077d83b42e3ef8b16..fc273f8f9e75de89dca1ac1aca3= 589567bcf8a18 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3221,23 +3221,17 @@ bool uart_match_port(const struct uart_port *port1, { if (port1->iotype !=3D port2->iotype) return false; - - switch (port1->iotype) { - 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; - 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 if (uart_iotype_legacy_io(port1->iotype)) + if (port1->iobase !=3D port2->iobase) + return false; + else if (port1->iotype =3D=3D UPIO_HUB6 && port1->hub6 !=3D port2->hub6) + return false; + else + return true; + else return false; - } } EXPORT_SYMBOL(uart_match_port); =20 --=20 2.47.3 From nobody Wed Jun 17 07:22:58 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 980D8329C6D; Thu, 23 Apr 2026 20:15:16 +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=1776975318; cv=none; b=Nx4aHSpmM+t+cjIbDzZi8//TpMXFojD33XFq4TVIppVWpEOnhB9YZG00fVZaaQb8AP0PGrhMSpzVwCtUFpzBC8s7PWzaYJTAD+i3byPNPuGYPflloAAPQ0pBA99DqRV/QT0rcEApPkZAm4EjMEBBWoSjCScQmx3nbMEFe0aSJ+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975318; c=relaxed/simple; bh=wWkMJWIt0ExRFLiKWzv1z0v7Lu1/jhfaN7tLbfJTw1w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RNTPIRT7JLm2KPElbAFGyiLfZvHrHobqC2i+0mOnUMz92y5cOwra/yzyAb1G8z8btWLg2LQKdnatv714RJgyM1YF1rhicw0Z5HvmRVrgnXIhn+LOHQXiSLJBfDDt1h2LTe9Yd8HOo2m6aZGh9QTYJkS/huAGf5OWh97Gpb3DYmE= 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=euqFzGhs; 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="euqFzGhs" 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=5K0LF2cYsT8/QNb5H9rVhaoZksrMaH8jYl8JUmn2GeY=; b=euqFzGhsvrSt3R56wVHH4VOl0v /GEaG5HhrWzVmkGjD56ABvkkdEO6g0bQaM5Z7qREfA8GqMDGImZDJUnNE1TLoRzJK+aXfS7DL0BNf Uclv0yC5P4AuYjB2qF8nXN3OFwUicwCOJgNBVLzWs0xVZ+tnMIOi2NAPOg/U6MSv0r/Q=; 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 1wG0S4-000000002qN-3DTV; Thu, 23 Apr 2026 16:15:08 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:03 -0400 Subject: [PATCH 3/9] 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: <20260423-tty-upio-v1-3-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/= 8250_port.c index af78cc02f38e719573becd0aea226f7790555a3e..48ff4cad028ff0b6a9c7167ea8d= 793b3cb0f32da 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2863,13 +2863,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 @@ -2883,14 +2877,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_legacy_io(port->iotype)) { if (!request_region(port->iobase, size, "serial")) return -EBUSY; - return 0; - case UPIO_UNKNOWN: - break; } =20 return 0; @@ -2901,15 +2890,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); @@ -2917,14 +2900,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_legacy_io(port->iotype)) { release_region(port->iobase, size); - break; - case UPIO_UNKNOWN: - break; } } =20 --=20 2.47.3 From nobody Wed Jun 17 07:22:58 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 217BF3290C4; Thu, 23 Apr 2026 20:15:15 +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=1776975317; cv=none; b=maAd437ugYnICOzmULoXnabce9joLeTvOGePm7rHqOqiC1zkdrEh+1Eaexisb+zol5hQe6U91s65QPxeSLGSxVKJwIADUgI2e9KB9SEWEmQh47EWKVveFoOhOb2iPHdqt+1+wQT4Ug1XwqC4xSgEqfuXfASR85k/+7KJrVRiE4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975317; c=relaxed/simple; bh=Y74DWDxup2fUetjkoIZTSIDdiJvZQtTb11FRF1PciRw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c+MDo36PEbUAVy8Cjmy3eMKpC0XP1LyrhwPnHOTp4syb9E/xNCOvgRE3rV1xkjJ5WxDi7QeHGakBnhI4LAjCTi+4AP4pJk5mBaFg5Zpdp5+hCHzoy4tdYje7W3pgAUtDfv2O+XI1LwfjVHkqzxvaYA33dsUpATRr30BUf6Gzbgc= 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=inwWUj4z; 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="inwWUj4z" 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=2wDVloyHkIiziVAMPkgP37/N8JFwAPIIdhpuh27nbB0=; b=inwWUj4z9zHKdcBQJjUSYvNcwY QiyXenE4trFgSyJghE0qvnspWRG35xRZIljnctrqcBk3AdmB/AkPm7nGSpt6WLXP36SELsJKpvWVk dUSc4tpvUjHgMLGRn3WgEX9RqGKionoxWKVY+yoIuMIEdhHW05J54/2uEVDQ3RPICSjo=; 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 1wG0S5-000000002qN-0xyP; Thu, 23 Apr 2026 16:15:09 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:04 -0400 Subject: [PATCH 4/9] serial: core: fix indentation/alignment 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: <20260423-tty-upio-v1-4-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 Fixes the following checkpatch warnings: CHECK: Alignment should match open parenthesis Signed-off-by: Hugo Villeneuve --- Without this, the next patch will have a checkpatch warning. --- drivers/tty/serial/serial_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index fc273f8f9e75de89dca1ac1aca3589567bcf8a18..cb5da344305e397b42f47bdbc2c= 053fc487ed784 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2507,10 +2507,10 @@ uart_report_port(struct uart_driver *drv, struct ua= rt_port *port) } =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)); + port->dev ? dev_name(port->dev) : "", + port->dev ? ": " : "", + port->name, + address, 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) --=20 2.47.3 From nobody Wed Jun 17 07:22:58 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 8E8221A9FBC; Thu, 23 Apr 2026 20:15:16 +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=1776975317; cv=none; b=VS6vzrt2lNezu3pVpxIf7Y8faRQ9RO7TxXjo3QCP7GqHPUulvvUYKtmbnrKeCcxt9TzVqB9x58DH2hoV9nmfwEetsQDKuf/dgykRAH7Mwq59S5mstOxYANlYWhxO6mSg3o7Xv9m/u8xAgX7n2mqjQIGg1YItaS1I1hqK5wb8zYM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975317; c=relaxed/simple; bh=hYqIBi0VFMy6IzsGunnD3iLdF1NANeFoJCk3H9NxnTk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sRzInP8BeWvkPaSkNIo6ynsc3paPV3nlgUi8VaRKoE8JU1qn7sPV1/nMBSmZa7T8DBlD7hfbvR4a0m/7WJRlSBGRr+eOUsK4NAR9cOvR2w5BbFVgaXRK8zmERqn9E2lhQSuJ+xJQQYLzBHJclc3LbafmdyAKrLEnRB1hMp9WfeQ= 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=maFIxuMD; 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="maFIxuMD" 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=qw+mWkwXmc7RqCOdYgUO0rX4W3Y65E0lYe2p4WpQZ4s=; b=maFIxuMDvkP/MZ1AQbqaBRjstW tVaG0yyWMsLuW3qBgKlr19pOTXR3bh2bsb8ns6l2Ke7GKaQMlNxx4V6wCuSOIXP2DSrHMEwgpQtLB mJyCx/3fR+eXbq2vWrwTKWbYEdlaYyM1PFuM7KAuOjjldHcrhqS+tNkso87CWpkm+RB4=; 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 1wG0S5-000000002qN-2dD5; Thu, 23 Apr 2026 16:15:09 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:05 -0400 Subject: [PATCH 5/9] 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: <20260423-tty-upio-v1-5-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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. 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 cb5da344305e397b42f47bdbc2c053fc487ed784..0bfdb69817e4259681fbc4658c9= a68200aa2b65f 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2527,11 +2527,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_legacy_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 false; else return true; + 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 fc3f5ebe389658c197ffc105ce4ac11cacef59bb..626dd939c53c9f920d71aadd360= ec0ea0bacce0d 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 Wed Jun 17 07:22:58 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 8EC9E327BF8; Thu, 23 Apr 2026 20:15:16 +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=1776975319; cv=none; b=ioPIhddrfjtZMonf/0XP1Gw8nyMPfHpyuwTLfq48BPUPPQWvY42rKmkIH6tsIeiPtQEsKasHMdTPKQBRwUQsW01NUtSRRBp8HwongjDDDU1TghVwbIwmi0OZ2LzYT6/KIhi1mVBI8IMrxQsKpKgB0s5vbP9yyYYUsqUDHtHksE0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975319; c=relaxed/simple; bh=6P4gjQeUyqkZF97RqGEygM/6K9ULdzSESt0MtGmufco=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s1TzZnp3Ka5eecXLdxkd9/sxlr+Fz4ITshypwhPy6LCZigXo2B1xwbv5SwSYUszRDqsS8awYcnn4i8X8CMUFuNlLAwAn6YoyTVZq46QRNv8GM2q9/ga5FxQE1BTfdjFSdpvOmewUi7BQxd5j6sinzkWzZ4+L7uLTnY8rn00s8zU= 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=UrxzoXvr; 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="UrxzoXvr" 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=quJn6qAWbfnZA21v7/MH0nq0k/2d9IRwFrcWpCuqHkk=; b=UrxzoXvrAktC/NAQM/8ITqXkUd nLosFiohbHVlGxPWLZpNwKtawvFbqqmCwnmKA0el8Hp+kaXWCENoxA0S8jN/WhUvcqTu+7FWwVXBZ wxgSc0V7ZkGPCOB1Z3DqX/FTLXsS1Rx/UX1I7HpbufiBQnZz0jaVcT92Mz/zAu8F+zoc=; 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 1wG0S6-000000002qN-1gPK; Thu, 23 Apr 2026 16:15:10 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:06 -0400 Subject: [PATCH 6/9] serial: core: prevent irrelevant I/O infos display for UPIO_BUS 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: <20260423-tty-upio-v1-6-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 It doesn't make sense to display irrelevant MMIO or legacy I/O information for serial devices on I2C or SPI busses. Now that we have a separate I/O type for these types of devices, prevent display of I/O information for them. Using uart_iotype_*() functions to do so also addresses the now invalid check for "iotype >=3D UPIO_MEM". Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/serial_core.c | 50 ++++++++++++++++++------------------= ---- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index 0bfdb69817e4259681fbc4658c9a68200aa2b65f..42559eda6fc134de77c3a7b850d= 565ebdc89e216 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2011,13 +2011,18 @@ 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)); + + mmio =3D uart_iotype_mmio(uport->iotype); + + if (mmio || uart_iotype_legacy_io(uport->iotype)) { + seq_printf(m, " %s%08llX", + mmio ? "mmio:0x" : "port:", + mmio ? (unsigned long long)uport->mapbase + : (unsigned long long)uport->iobase); + } + + seq_printf(m, "irq:%u", uport->irq); =20 if (uport->type =3D=3D PORT_UNKNOWN) { seq_putc(m, '\n'); @@ -2482,31 +2487,20 @@ EXPORT_SYMBOL(uart_resume_port); static inline void uart_report_port(struct uart_driver *drv, struct uart_port *port) { - char address[64]; + char address[64] =3D ""; =20 - switch (port->iotype) { - case UPIO_PORT: - snprintf(address, sizeof(address), "I/O 0x%lx", port->iobase); - break; - case UPIO_HUB6: + if (uart_iotype_mmio(port->iotype)) 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; + " at MMIO 0x%llx", (unsigned long long)port->mapbase); + else if (uart_iotype_legacy_io(port->iotype)) { + if (port->iotype =3D=3D UPIO_PORT) + snprintf(address, sizeof(address), " at I/O 0x%lx", port->iobase); + else if (port->iotype =3D=3D UPIO_HUB6) + snprintf(address, sizeof(address), + " at I/O 0x%lx offset 0x%x", port->iobase, port->hub6); } =20 - pr_info("%s%s%s at %s (irq =3D %u, base_baud =3D %u) is a %s\n", + 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, --=20 2.47.3 From nobody Wed Jun 17 07:22:58 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 8CF2C32E143; Thu, 23 Apr 2026 20:15:17 +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=1776975319; cv=none; b=RGbERBt3ULqKj5nhpm4qhZ60DhOuNwn3rd7zukhdAcyLYeJp6w7ow26Zci8ekCK+CQFhmw3BjSWUxWicmAc0V5uTIe7xyHqa1XRvfY673ypT/BKk1Sth/OccYVjSUuQYCeqnw5gySPCupqELLucV+5ZdCzsCxuZjV/qG779h8Ps= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975319; c=relaxed/simple; bh=LTUpd3TmgtJfdNwrIKLkibUpsbTlF2k8wljPMrLkzgY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bszJ/pdpBqANF82+l4xVPBWGRnwi9pu9+lZ5IDHT9QJVPLL+OOFHoN1ZDNQXe4WYM00Nts16Q2aXt9wcPWkn654VhZKRK8KVGMrtkGMB/UD3za9ZWaqWr+KjGyUn1uAAkp5zTQzLLCut/hHrkSAydzyp7TlvGLporEkq1xWamu4= 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=0Vwv7rGV; 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="0Vwv7rGV" 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=0Vwv7rGVnqntUxtkBVvEGia9a6 dsbRwkkwHMSJHJO5SRJhAVcT44X6UaTwuAKNqdf2sP1nRcUjZLhFt4Zkd/VPeCVOTb+kOlHmPKPBl H7seqsb9KU7g+y5gVZWy01R2ta4YtH2X0BBeDzPtXhvI7ybXSP6zfXEtHpHBL6/RBp2k=; 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 1wG0S6-000000002qN-3sBd; Thu, 23 Apr 2026 16:15:10 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:07 -0400 Subject: [PATCH 7/9] 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: <20260423-tty-upio-v1-7-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 Wed Jun 17 07:22:58 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 8CFDD32E6BC; Thu, 23 Apr 2026 20:15:17 +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=1776975319; cv=none; b=HUxn8duSgyEdJ3g/gC/nlcRpIS/NLwWeYfWgbI3eA6PpxY90+F793OeXUg2vt4JiHP5VJ0Ksaj95ANQwdFXSAfNq10TYitXaDfIIrqMVwKy/bLksdf4Gyd7Vtc+V4cE3SP1MxL20yBjyTr4h6ddSJztgTpsGMlm5BQ/ti6YmufE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975319; c=relaxed/simple; bh=iLLo/F+Zqk49oSOm6IOqU5eaDxZEgFxpY8X6Ei152tM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q8pSiIpDJVRv0WT3sqrKrrQ1CR8sg/oQCXHBoblViKsX9PELWBlIb7CwCJJW7kfmYgqQb6weWebVdeGOh3c6NoKU8/n86c++0TR57yU9OZ+DCDZPiXJPco6iZ/FtxyD+UzhRwott4KLEq7Ds8yLKVcb48VWFez9i3N+5HvSWGW4= 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=yCm8sN9F; 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="yCm8sN9F" 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=yzXpb/zzeucTfNpYVg6pG6UVGJTqJuRg/3w0Quig9hE=; b=yCm8sN9FDPIY3L9jZzgEa9xuBj Kwwngh2PABM4KUL69Z12bEk2oFDkxFI5ZT8J8uAGzqtXnJ3x4gMU4R43AI5T3+rv7j9kI+t9mwBuV KkMYVzBzvC/5Hi+ruaQ6uvo8q3qYBJDeBTVtv/dhINTiGopi5Q7tr6YKjs9NW6FlqGpg=; 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 1wG0S7-000000002qN-1kOS; Thu, 23 Apr 2026 16:15:11 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:08 -0400 Subject: [PATCH 8/9] 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: <20260423-tty-upio-v1-8-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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 ac7d3f197c3a5ce3531d5607f48e21a807314021..cd0496e307091dae1f53911abf8= 6726f52d5770d 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -1380,14 +1380,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 Wed Jun 17 07:22:58 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 7D7C433B97F; Thu, 23 Apr 2026 20:15:18 +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=1776975320; cv=none; b=WNfHq3LDH9vAtcefXwTiXv9FX+8rqLfNkiviEBDu6Ot0zuOMZjJ50kQllWvPzph2Twsn2chj/ViA9QKE/Q+xrVKiu3Ny86Gqp5qlJ382Q4fHpGl+OSfLhYeQAwqjgNG/8cLxBd0VS+VKFHyBsdzhHAfigBV7wCzYaQ8rQNjS0Go= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776975320; c=relaxed/simple; bh=EJPrKqBxkdjXERiK4cwkc7VD6yOaOR5y0dyDPxd8axY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Npokl8YLmSzP5nLDWZiR8b8cGwjR6M+fXIBsg8rp1Bq0B00evuVCZCsGumSO8GKrClDdvTcgMOCUexBB8eIrSGVZNcvus0Cb+aVEmq/0usMnwxYIeO19189VVwvt97JufOuE03HWiF94qqYxdiIe6O6xxsfaMN7+l3Mc17PyZZk= 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=NoP5XyPa; 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="NoP5XyPa" 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=NoP5XyPaOS7MHXfqFYTAEZtVNk fPHB6FU5CA4SewrId3LvhC7eS2BB3WLFp+FMRodmI9ao/9M4k6EskBFUpB1tvdLesUilFJeTRyIwq ow89HLt08fjZizKJjHqMsPteGgqcg+Hn5p2cmFI9x7F+7EB3rCa06K5d7pclaYVecAIg=; 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 1wG0S7-000000002qN-3F4H; Thu, 23 Apr 2026 16:15:11 -0400 From: Hugo Villeneuve Date: Thu, 23 Apr 2026 16:15:09 -0400 Subject: [PATCH 9/9] 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: <20260423-tty-upio-v1-9-baf82d3b86d1@dimonoff.com> References: <20260423-tty-upio-v1-0-baf82d3b86d1@dimonoff.com> In-Reply-To: <20260423-tty-upio-v1-0-baf82d3b86d1@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