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=1796379526; b=Qg8lNpV6R3Cci4MjJiHZSSenr/kACm1+ZXsbuucnhDGjXWUgTAhFDpauLgXmQxbWSRHD 3tu1ZFoUZnpFcFuX5fZmwqkBpFbMZDf2GOPPxx9tU6t6v+mc+HcXGKTHdigAFEmLf+yp6 xlttUmpDo8CfjorrXWBVIosdqPzAyYroyVPGiyoYAy57XpzgaYPutNGS3iR+u7GOYbyZo nqkgpVpdEo/QX0Dds3+S/QfLTkuZQq2iu28H73CPAhnbpRhpR3S2g2bNMT+CBjT13EPq0 6OsL0oAm8FrOXf8pb8sCQqSMUheZWq1Ep8AYnW6zUItKF3F3aE2ai5ZiISJvFz6oYxQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379526; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=0yfU+na4g4FqMZUVnCUCYaZi++6uNbZVJBtmYCyg8rs=; b=vdu3HZJedFvMIVG/+U9bes61WalvzfnI8mW5KWOwfWxZIEC0MFzQKJZJCy8kEADnjrlQ F2dZqzV6V2BniED0QbXWVpNUVN2fjU/tueksq/2oqVuhGWe2aRLJNQCXjbH/vfIbxGIMs StNGiHx9QcYUCCJH4EKMt6UEaJyRYLUmNWYuQpS4urS30KCtWsD5d3xnXT1YVeHZoR3Ug l9KvAVNILlyKpJojpaQnf+d3Q3qqOyeT1K7+h9QU2V1iMyZ9QvN/BoYmkIPhNvM/vU0ph MmInCfq2V75NJV3JeUUWFjrS26wcYWxBsg6iBmqleV+uq/Y7asLgCC/PDYuV3zd8A4w== 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=AD73Plpm; 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 74F5F606A322; Fri, 4 Dec 2026 10:18:46 +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=AD73Plpm Received: by smtp.kernel.org (Postfix) with ESMTPSA id 205061F000C2; Fri, 4 Dec 2026 10:18:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796379526; bh=0yfU+na4g4FqMZUVnCUCYaZi++6uNbZVJBtmYCyg8rs=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=AD73Plpmv17uDjgF8USmPab3H8BsyTRuiUesuxSONN140EflsqWp/xABp04BMompe K3uWa6c9DL3mtMLM7xUpdF4WOACIOFocBQclTq7944WBLzA/zTjOD9D4YHO9av6KWn Ppj1k0w0bXOxRdsZJV0R2pQrO5g+Dj18aP1wbDOplQ/79aPicKqWmgrBBCVAxk/z0w rbNBpgb9ezqSFqw5whqvFvGCHvXwn+Tu0WYjZIn7fZU1nNhUeEpfmd5I7VYN0vUAPn UVMp6bi4uc1Vruy97RSw6dfTkyaIOlMiFIP4c7DT9jRJnIvnXn4ks/gwOnSab3UR6j bTu4+ICUIx3yQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v14 1/8] serial: 8250_omap: separate locked TX DMA completion processing Reply-To: sashiko-reviews@lists.linux.dev To: "James Hilliard" Cc: linux-serial@vger.kernel.org, imx@lists.linux.dev, Frank.Li@kernel.org In-Reply-To: <20261204-submit-serial-8250-dma-cancel-v1-v14-1-b691fec8097d@gmail.com> References: <20261204-submit-serial-8250-dma-cancel-v1-v14-0-b691fec8097d@gmail.com> <20261204-submit-serial-8250-dma-cancel-v1-v14-1-b691fec8097d@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 10:18:45 +0000 X-Mailing-List: imx@lists.linux.dev 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: - [Low] serial: 8250_omap: commit message omits why TX DMA helper is split - [Low] serial: 8250_omap: confusing TX DMA completion naming and missing lock assert -- commit bf5c2c6d6a0451f17f908969e422608e25f2e9a0 Author: James Hilliard > serial: 8250_omap: separate locked TX DMA completion processing > > Separate the port-locked completion processing from the DMA callback > wrapper. Keep the shutdown check and locking in the callback, and retain > the existing FIFO accounting, delayed register restore and THRI handling > in the helper. > > Reviewed-by: Raul E Rangel > Signed-off-by: James Hilliard [Severity: Low] Could the commit message explain why this split is needed? As written it only describes what was moved, leaving omap_8250_tx_dma_complete() with a single caller and no context for why the dma->shutting_down check stays outside the helper. > diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/825= 0/8250_omap.c > index 4f672b0371022..d18dca27a4c22 100644 > --- a/drivers/tty/serial/8250/8250_omap.c > +++ b/drivers/tty/serial/8250/8250_omap.c > @@ -1080,18 +1080,13 @@ static int omap_8250_rx_dma(struct uart_8250_port= *p) > =20 > static int omap_8250_tx_dma(struct uart_8250_port *p); > =20 > -static void omap_8250_dma_tx_complete(void *param) > +static void omap_8250_tx_dma_complete(struct uart_8250_port *p) > { > - struct uart_8250_port *p =3D param; > struct uart_8250_dma *dma =3D p->dma; > struct tty_port *tport =3D &p->port.state->port; > bool en_thri =3D false; > struct omap8250_priv *priv =3D p->port.private_data; > =20 > - guard(uart_port_lock_irqsave)(&p->port); > - if (dma->shutting_down) > - return; > - > dma_sync_single_for_cpu(dmaengine_get_dma_device(dma->txchan), dma->tx_= addr, > UART_XMIT_SIZE, DMA_TO_DEVICE); > =20 > @@ -1123,6 +1118,18 @@ static void omap_8250_dma_tx_complete(void *param) > } > } > =20 > +static void omap_8250_dma_tx_complete(void *param) > +{ > + struct uart_8250_port *p =3D param; > + struct uart_8250_dma *dma =3D p->dma; > + > + guard(uart_port_lock_irqsave)(&p->port); > + > + if (dma->shutting_down) > + return; > + omap_8250_tx_dma_complete(p); > +} > + > static int omap_8250_tx_dma(struct uart_8250_port *p) > { > struct uart_8250_dma *dma =3D p->dma; [Severity: Low] Can the adjacent names omap_8250_tx_dma_complete() and omap_8250_dma_tx_complete() be made more distinct, and should omap_8250_tx_dma_complete() assert p->port.lock? These two functions sit side by side with opposite locking contracts yet differ only by swapping tx and dma. Because struct uart_8250_port * implicitly converts to void *, calling the unlocked callback wrapper while holding p->port.lock compiles without warning and self-deadlocks. Unlike other port-locked helpers in this file such as omap_8250_rx_dma(), omap_8250_tx_dma_complete() omits lockdep_assert_held_once(&p->port.lock), and not all paths through it reach a callee that asserts the lock. Renaming the static callback wrapper (for example to omap_8250_tx_dma_complete_cb()) and adding lockdep_assert_held_once(&p->port.lock) would make the locking contract clear and lockdep-enforced. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-submit-ser= ial-8250-dma-cancel-v1-v14-0-b691fec8097d@gmail.com?part=3D1