From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796210982; b=j/0znpkL3rJTATtXb6q6cUKaxwKmQ3NO1zUlY4mpFYTs2O58C3SHTT7UGlBp6o1umMbt sSSCb6sOPvMJnl5aMk6rfpnBdP3WDe6D2INqo8xTMIuJ/lFy8ZzQ7ymgwsFnIfHovUuN6 DsG9rekCh3OxJFbC6nraEs/6c+0g+kXlu0ZFf+qSmPgcIiGcgHltay3JcUHaUCy+JvJsh i4/cJx+Z1CMBdh+ld46DEAfEK2Ax66KyUvOYohM2XxuoYnXryM2rKYa8Qflg1lmT6QNLz hHV0xtw+uNEEnRH9Yd+F7sOlbZAp1HNo6seOHP3q3rIbj+PXAVTEJTudDmlVaPMluMA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796210982; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ub8xzx0aTBu+dYAqSLs8RiMqU61Yvh3wp31VJ4Ahxi4=; b=DW3G585fDevXzxdrDLEuWH+B/oPk/1QaAEoCX8WqmbcnvqS8ameak3vua4oABlpMR7JX C1dE/1hVpt+OqrfERncvsAsAsDZOS402ljmQfWhn0Cth/TMPelOub68QxsGD4qyjUSnR1 5Ad/yANcHZOWalEXXa9u8Li/T6OLV96INcZ+xs17kaAknMTtcwAKjmjN90uIcHw+2YsKF ymIZzZsUqkxVqpLIE0dJZ5nwWCnbs3JGNcPbG0WDknDtTSB2YsOrxEuHchsdZUKk/poq2 dI+POfw+6Xz9ktvYisTlgkezaXDt+WfDTUGXWNvprSL3i62QaECAj/sdDE7P+xxphFQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F49JsgXz; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BF56606A31A for ; Wed, 2 Dec 2026 11:29:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=F49JsgXz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 769C01F00896; Wed, 2 Dec 2026 11:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796210981; bh=ub8xzx0aTBu+dYAqSLs8RiMqU61Yvh3wp31VJ4Ahxi4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=F49JsgXz9vA8WgfDj+UEM6MsQ+oZqcYG8Txdug6bjTiWkiAkYcPp2J4QmbOefipYe eoINU8Hn+ahxNEdgInP/UN5ih35DHnXsp1JVct4FYEvHmWolp9++XxOTwd2LwqOz4A KkXYhOykY5IDNUS8eDBBl5dFsYzqjwSzjsolcXJLq4Tw1pEPAkQi3Hu6xfo3dA6/W8 0qo5hSwO1iPjAp34nyRaPJFBcIVnXI7d76Q4zG8AuHCHw5u2rwRBpy7jvpx+1G7xrV ZtqZ80+8IMluoyb50Q1VnZPs04vTqsaKy2k7T0s/iqR1wx8xOZZwz2TQyJWkh68RkM 9Nn1H8dQOCx8A== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] serial: 8250_of: set UART_CAP_NOTEMT for ports with rts-gpios Reply-To: sashiko-reviews@lists.linux.dev To: "Nicolas Thibert" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261202111032.981532-1-nithibert@gmail.com> References: <20261202111032.981532-1-nithibert@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 11:29:41 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [High] serial: 8250_of: setting UART_CAP_NOTEMT skips uart_config default flags - [Medium] serial: 8250_of: gating UART_CAP_NOTEMT on rts-gpios misses native RTS em485 -- commit 3ce247ebc56619daf138861af9c248e9f1ac7b45 Author: Nicolas Thibert serial: 8250_of: set UART_CAP_NOTEMT for ports with rts-gpios This commit sets UART_CAP_NOTEMT on 8250_of ports when the rts-gpios Device Tree property is present so that software-emulated RS485 direction control releases the direction line after transmission completes. > diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/= 8250_of.c > index b41ca604083f6..b58535f73cb88 100644 > --- a/drivers/tty/serial/8250/8250_of.c > +++ b/drivers/tty/serial/8250/8250_of.c > @@ -292,6 +292,9 @@ static int of_platform_serial_probe(struct platform_d= evice *ofdev) > &port8250.overrun_backoff_time_ms) !=3D 0) > port8250.overrun_backoff_time_ms =3D 0; > =20 > + if (of_property_present(ofdev->dev.of_node, "rts-gpios")) > + port8250.capabilities |=3D UART_CAP_NOTEMT; > + > info->uport =3D serial8250_register_8250_port(&port8250); > if (IS_ERR(info->uport)) { > ret =3D PTR_ERR(info->uport); [Severity: High] Does setting UART_CAP_NOTEMT here drop UART_CAP_FIFO and the rest of uart_config[type].flags when the Device Tree node omits the optional fifo-size property? Earlier in of_platform_serial_probe(), UART_CAP_FIFO is only set if port8250.port.fifosize is already non-zero. When fifo-size is not in Device Tree, fifosize and capabilities are still 0 here, and serial8250_register_8250_port() -> serial8250_set_defaults() only loads the per-type default flags when capabilities is 0: drivers/tty/serial/8250/8250_port.c:serial8250_set_defaults() { ... if (!up->capabilities) up->capabilities =3D uart_config[type].flags; ... } Because capabilities is now UART_CAP_NOTEMT, uart_config[type].flags is skipped. Without UART_CAP_FIFO, serial8250_clear_fifos() becomes a no-op (including during serial8250_em485_stop_tx()) and console writes fall back from FIFO bursts to single-byte polling. [Severity: Medium] Should UART_CAP_NOTEMT also be set for RS485 ports that drive the transceiver direction pin with the UART's native RTS signal instead of rts-gpios? of_platform_serial_setup() enables software-emulated RS485 (serial8250_em485_config) for all 8250_of ports, and serial8250_out_MCR() toggles UART_MCR_RTS as well as any rts-gpios. Gating UART_CAP_NOTEMT on rts-gpios leaves native-RTS RS485 ports with the same bug where __stop_tx() returns early when UART_LSR_TEMT is not yet set and never deasserts RTS. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202111032.9815= 32-1-nithibert@gmail.com?part=3D1