From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 456F83D6CCA; Tue, 21 Jul 2026 22:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784673448; cv=none; b=fdot1Vi3UPHzyLFRlVVDsXzUYobz8ZlqFh0G1kXGX1wMjHiO5+oUdxbLTYi/bM4NBA7VGcCohJRX/LA9xQbUNIoKJMxrD/cpiExctPYvHtKAPRX7ue5j8JEOM+TkPX7C2sR3P6SB1o13Exud9Kh7neAcbZNhO4A0ZkBg4Lh6bO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784673448; c=relaxed/simple; bh=phzhqetDq7c7kwI1U/ShScdfSkRvIaOCJdZuupXUL1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BVRNF3KH5dacYjKXqweEl4LS6gZgNZP9fo4lN7QPltzKu8Dvf/8UT4vSPF+mRbrBztN0GVy6WEtjz/OpjmOuF33aCmZutFv92Wfe8lnk8V/69EnKvSGRY+yoYONe3ax0Cj07graGe/qYYmv9I5mzYLu/OmP3aQVDINXOpF12vsE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UYYAj+cS; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UYYAj+cS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1DC31F000E9; Tue, 21 Jul 2026 22:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784673447; bh=39puYlK6ZgheWA7aW3wNiq/G/r0TESB7USkYISwIiCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UYYAj+cSdLg1tJDZ9Z68CultV9tyjvTnmqs3+iSr7YKhNRXZa4H9TO5yynB5KLKxk Sdt3qzGtWAOlotU9G1LVYGJYbby99KcdPTtYpG0ahZshc4rsawOIjLWGt6Ayl7DjD3 FD9JsE5OSH+dQTP9GTOQ40hn1NLsh2JYi+/2V5Z0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable , Matthias Feser , Moteen Shah Subject: [PATCH 5.10 165/699] serial: 8250_omap: clear rx_running on zero-length DMA completes Date: Tue, 21 Jul 2026 17:18:44 +0200 Message-ID: <20260721152359.426384122@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260721152355.667394603@linuxfoundation.org> References: <20260721152355.667394603@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Matthias Feser commit 061b627ba534230a18ec4d7251562af12325d06a upstream. On AM33xx RX DMA only triggers when the FIFO reaches the configured threshold (typically 48 bytes). For smaller bursts no DMA request is issued and the FIFO is drained by RX timeout. In this case __dma_rx_do_complete() can legitimately see count == 0. The current code exits early in this case and does not clear dma->rx_running, leaving the DMA state inconsistent. This can prevent RX DMA from restarting and may cause omap_8250_rx_dma_flush() to fail, marking DMA as broken. Fix this by clearing dma->rx_running once the DMA transfer has completed or been terminated, even if no data was transferred. Fixes: a5fd8945a478 ("serial: 8250: 8250_omap.c: Clear DMA RX running status only after DMA termination is done") Cc: stable Signed-off-by: Matthias Feser Reviewed-by: Moteen Shah Link: https://patch.msgid.link/BE3P281MB55155F2F5795E411F5A65282EE0B2@BE3P281MB5515.DEUP281.PROD.OUTLOOK.COM Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/8250/8250_omap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -883,11 +883,12 @@ static void __dma_rx_do_complete(struct dev_err(p->port.dev, "teardown incomplete\n"); } } + + dma->rx_running = 0; if (!count) goto out; ret = tty_insert_flip_string(tty_port, dma->rx_buf, count); - dma->rx_running = 0; p->port.icount.rx += ret; p->port.icount.buf_overrun += count - ret; out: