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=1795023248; b=EqUu1/JP4tnPzhFymw1c8uh+rGR9atrvmTDqiXZIQnNMDLuDihgV220WRzO7J0gp7QzJ xQRVHQ06fLI7XGK6NuS0C3NEKr0Bo7lY97lmGogTo91Wunw8ui6FLLW4KHo88rAgqcAO9 FOlYsRMZElLkDdNfB0XGBShczlv9VXTLH6/OWWo74vdJm7oc0ZD045rMOY+RQB6hLlpN+ KhJy1LNNd9BkGLzwGlTf2hbOtIoikRkE0TmG2g+LZ/tqEmbM6GLKT+B2vFffS81HmWbIk ONZNl4UtPZpDrw1vbq7J+eh6hHQUkXW3TdBjVQdQwmHC8h74rqR3j/FWtI+rADwbO1w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795023248; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=WyULJHYx2wE7HeOPApqttxPX4Y2FGoKn6BXQ/GG/8/M=; b=xO+aW5D9cLgkbft8xZC0G0JJWSCrYMG+JdYOODT5rfVP5HWQeypllYu3GErSzBZri2/5 aK1jEZ3TXHLXTPvjys3LWFNyFvabVlJI9WaBH0gw2+gQNnKuuIKSBA7vEAWXzDnEWlmvC vjAbqw4wCpLXqd3PoXe5WVNFyip5Dvu78lMFEmj7vWfmcGK79h03NT3Nc9pbQg0bVztq/ ypp6v4olaUjtXrg2aI3mHlEc08PwDFA7Vgjokxl1dtMlsN4N/nEfXA5zLy6v0fDiZpjT+ 9RMyjSEYkiocQ0ni6MHdPiVHUvhGhRvEQ1p4sOuONLnXYClESNG4FYtiWLr3ojwCG8g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Viyc7OwX; 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 665BF606A325; Wed, 18 Nov 2026 17:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Viyc7OwX Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD9671F000C4; Wed, 18 Nov 2026 17:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795023248; bh=WyULJHYx2wE7HeOPApqttxPX4Y2FGoKn6BXQ/GG/8/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Viyc7OwX+7mcVG6vFkmxUv1vHHyzkG/uyouKwKwodGMr/NeBijnG0ceCRMBTUuJlw LhdCrK0tZJL4G0c4nalCWyFOXtiY1iNH2pVf0Ox9rLGJmTrODnejdGXu71VVuao2T1 vOadMoc5YYqUXfKD8zT9HJ0q379GKOW8JQQGRN+Q= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Radhey Shyam Pandey , Srinivas Neeli , Frank Li , Vinod Koul , Sasha Levin Subject: [PATCH 6.18 0303/2151] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit Date: Wed, 18 Nov 2026 15:33:58 +0100 Message-ID: <20261118150132.951783629@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150121.603863898@linuxfoundation.org> References: <20261118150121.603863898@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Srinivas Neeli [ Upstream commit 5b585cc8778185ae7a7c9903f8cd70d562b91282 ] In AXI MCDMA, xilinx_dma_complete_descriptor() walks the channel's active_list and unconditionally moves every entry to the done_list. The MCDMA IOC interrupt handler invokes this function on every interrupt-on-completion, but with interrupt coalescing (IRQThreshold > 1) an IOC interrupt may fire after only a subset of the queued descriptors have actually been processed by the hardware. As a result, descriptors whose completion bit is not yet set in the BD status were being reported as completed to client drivers. Add a check for the descriptor completion bit before moving entries from the active list to the done list, using the appropriate direction- specific status field (s2mm_status for DMA_DEV_TO_MEM, mm2s_status for DMA_MEM_TO_DEV). This mirrors the AXIDMA fix in commit 7bcdaa658102 ("dmaengine: xilinx_dma: Freeup active list based on descriptor completion bit"). Fixes: 6ccd692bfb7f ("dmaengine: xilinx_dma: Add Xilinx AXI MCDMA Engine driver support") Reviewed-by: Radhey Shyam Pandey Signed-off-by: Srinivas Neeli Reviewed-by: Frank Li Link: https://patch.msgid.link/20260818174151.1608971-3-srinivas.neeli@amd.com Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/dma/xilinx/xilinx_dma.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 20dc3f4a15c9a..797b7b9e7a814 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -1770,6 +1770,17 @@ static void xilinx_dma_complete_descriptor(struct xilinx_dma_chan *chan) struct xilinx_axidma_tx_segment, node); if (!(seg->hw.status & XILINX_DMA_BD_COMP_MASK) && chan->has_sg) break; + } else if (chan->xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA) { + struct xilinx_aximcdma_tx_segment *seg; + u32 status; + + seg = list_last_entry(&desc->segments, + struct xilinx_aximcdma_tx_segment, + node); + status = (chan->direction == DMA_DEV_TO_MEM) ? + seg->hw.s2mm_status : seg->hw.mm2s_status; + if (!(status & XILINX_DMA_BD_COMP_MASK)) + break; } if (chan->has_sg && chan->xdev->dma_config->dmatype != XDMA_TYPE_VDMA) -- 2.53.0