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=1796379189; b=abCIjmCnhCpCoqXMa/r2dWBr+IOzItGJV4wuRcDXLurGpsBLCrFfm9cVwQlgLMXKIzM8 0KwTGwoRd2Pk2s5qgPHzDFwErCmIiLXHTNubkQ6JCBfmfDQFnr2BBx5/qJ7Kw5wZjuwcj dDDgGPeN3n9hjjXsZ5BsM43ZpsG36klMmfqVv0aqGh67BSvNfcjjXfIKBLm2GE/Vv4XQC VKMPerTzLUFgcEMyNN1hzanHxRGBmHntehy0qL8Cgql8lJvZlXXv8TOeVFz6ai9D+ocqi LnY03dg7mgo2I6nVGri7cGyipXPc7Yq1oshOjSwfquhforzYZOBOtRSeI0nXZsrnc7g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379189; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=NvvClSP0kHx2UmA/l2N1mH1AkOQ98QiOawOyAHRRJh4=; b=saEHrbm1DMgICcC6smqCd5iTbXYBYw9xQBKY/zlGiep76EtAGHlXTf+NV2jZWQkTMTLX /Fd3a9yoeFOgZcDjsJlyVeVhhrlGFxNiJqXfqISHO1LdMSTR2ZQXJUMPJ4L6vBLFWLnpP GnsNA1SjjiFXc+k/i2i4o7Lr6FNZttIh1/pH9H0bNjKj/k8i2JfUgheH5431CEhxU5VDb dKysN1bMO87Kh+JY2FL0F/6+WLYGh2hAMslltwl82QkKDEmWXwNstLl9/9pYSJLJUUvSX tWa/7gFXGMP6tGm0OxY0EGDdis7n4qqXb51nLsgTJyJdVxf5rfiT+zRnyX2mSUf7EMA== 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=lL6nMF81; 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 00C06606A32C for ; Fri, 4 Dec 2026 10:13:08 +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=lL6nMF81 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D4821F000C2; Fri, 4 Dec 2026 10:13:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796379188; bh=NvvClSP0kHx2UmA/l2N1mH1AkOQ98QiOawOyAHRRJh4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=lL6nMF81k7LlIvx0ZPPyHS+ud0UGlgP8OQytODgVlrzh5usfAVeVdIamwDMz1YovO TLNIHWuESmNXud127NK8l5J/SIGkoeBrimwbuHpaqPtDVrReP5Es4pmSKJ9Lkjyzzs uTDDxY0HuLHV+52hyQT//atsPvKpWIbQtvbigtR2DaRuvs70cgEUgsO9FbMrbEIa/q 4VSCkU141atQok4da7vY5NaUJt3uh+uknNmk5NA/qXzQifunVQk9smGaKlOsyPkDQ4 6yAvSSiaGrZXmjVNRVlDLw867iPUrgWqNCLYD2nbIJuLu8S7bKaWn3OqPW8IkP3Jqm /wX8sbLOFivMw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2] serial: 8250: prevent DMA callbacks from restarting a closing port Reply-To: sashiko-reviews@lists.linux.dev To: "James Hilliard" Cc: linux-serial@vger.kernel.org In-Reply-To: <20261204-submit-serial-8250-dma-shutdown-v1-v2-1-ebc7ee4852f1@gmail.com> References: <20261204-submit-serial-8250-dma-shutdown-v1-v2-1-ebc7ee4852f1@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 10:13:08 +0000 X-Mailing-List: linux-serial@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > Disabling UART interrupts does not prevent a DMA completion callback from > running. A TX callback can submit more data or enable THRI after shutdown > has cleared IER. An RX callback can also submit a new receive if data is > still present. A callback already running when terminate_sync() starts > can therefore restart the channel whose buffers are about to be freed. >=20 > Mark DMA as shutting down under the port lock when disabling interrupts. > Check that state under the same lock in the completion callbacks and > submission paths, so callbacks either finish before the shutdown boundary > or leave the channel stopped. The DMA provider's synchronization still > has to drain callbacks before release_dma() frees their resources. >=20 > Apply the same boundary to OMAP, which has its own shutdown and DMA > callbacks but shares the channel-request and release helpers. Check it > in MediaTek's receive callback after taking the port lock as well: its > earlier private shutdown check cannot serialize a callback that has > already passed that check. Reset the state after requesting channels > on the next open. Leave the Broadcom integrated DMA path, which manages > its own shutdown state, unchanged. >=20 > Fixes: 9ee4b83e51f7 ("serial: 8250: Add support for dmaengine") > Signed-off-by: James Hilliard Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-submit-ser= ial-8250-dma-shutdown-v1-v2-1-ebc7ee4852f1@gmail.com?part=3D1