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=1795015800; b=iZgD3U1Ip2Ixqv/pgDfU/uC1DW+r5cP4vTWF6caxzWNXzLlcXgChMtyOayNaw/9wzk/J Abl5TSz5jJhnvn/sQzuFXsFvLK+9NZQ6q+UKIzeG2U7SrpB07pLupqfyGjMRVTRI1x+Gu SbC2Up3cNgXwT4wGJA9XpuDTIhgEZf0WQja6odra4TWih9etgskmbMXBLeriM50d7JRAy ZpV0ywsaenVTBr89leqHDnq90+BNMnTZZViKFjp5b+Q88avEsU/ZYvLtO2oOxMKOVKc9j hrWfNCFg1u+D210T3zqe5ydG8u7MwncF1G4D16S0yMk8nlS65xVqmoBAX8BDTrluPOw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795015800; 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=2Ea1CB55AQz5JV5Q1JeRGLvUd8+CwFcPaHl4NPZt5P0=; b=A7B/PER6VetUKXKK5cMksLr5C/+LztKJrefi9wS4KQAKilKRTqJsA8+VasU9GfzfZLJK Uih3Bz12YBk59RauGrF930TNyCaMS9vJafuj0Y3OJK/Ef7XZedjMJjoiA1GdmrhSRfjXz wx0ei/7I6ur3WSJNWjncgpGneuHBkY7UKn5ZmQTkCJXjYEBOzggVQNR/HadJcJic7THOa kQ7pCkhPKtVqSNmAQoAmMz6D5AbvKbiJ/s+eEfZHOBbb6G5GlhrNXA5rSJOehMMxVbB6r 0NxzxcQ8oHg0Gqj2ptL6UpKSsCVqItFGbmli7AnBsMLuxb4MDXjkhFLsDUFD/zh8M8A== 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=XEB5xjZc; 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 22C0C606A325; Wed, 18 Nov 2026 15:30:00 +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=XEB5xjZc Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72E101F000C6; Wed, 18 Nov 2026 15:29:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795015800; bh=2Ea1CB55AQz5JV5Q1JeRGLvUd8+CwFcPaHl4NPZt5P0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XEB5xjZct4ZKYpCEhMPOcN2tOFfW2BhKfGLVl67qjQyHI1OYTE38rNfEddbq3hgJE HmgSn1X13rziI/EB5f8/D7l7Bkw5UyU+7DMUTLrG4S/YlUQwUdy8TvykbUX4O6v2c8 KwZDIU+AWiES+x5h0f9Inn99493hlAtFJLq1pmpE= 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 7.3 0303/2651] dmaengine: xilinx_dma: Move descriptors to done list based on completion bit Date: Wed, 18 Nov 2026 15:25:43 +0100 Message-ID: <20261118150258.809273382@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150247.972732815@linuxfoundation.org> References: <20261118150247.972732815@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 b826216ddaca6..1792e8cefad2a 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -1794,6 +1794,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