From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2F6F52E3AE3 for ; Fri, 27 Jun 2025 15:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751036421; cv=none; b=mffQaWY9fl0R4bZfh5mDPJgYnNTeL5v0GGxT3s8Lzpi1m8FiBAb6KFG3CmcKYS8y2A2bQ8fFAtbsi8KoBB5k4KCE65JPc+80BOc2QnODp8xlzQ/FgXg3bPlJ/05JLztFnZdzauczgD35Cr8raMu3/WwdomrfNds4uu+3/prNCWE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751036421; c=relaxed/simple; bh=D4LjaHZR/09nZPys9yZQRYoUbwhb3n+f1/qk1ZiFkG4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ZBiz5Wy36WigD42mVm47sYufVYmkmAhelOsA4SOapJfA8peFNybGbiQh8bckPI8xjZdpJPaPJaWam2s9LzMAiNd80Bth3QdNf0hNKYBRHWtITmmEKxXybABnB+6VvW8sJPOzfwAJIYKHmyf3WU5lzZfloH8PBVKcrplZq2xBx1M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dH1v6jmG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dH1v6jmG" Received: by smtp.kernel.org (Postfix) with ESMTPS id D8287C4CEED; Fri, 27 Jun 2025 15:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751036420; bh=D4LjaHZR/09nZPys9yZQRYoUbwhb3n+f1/qk1ZiFkG4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=dH1v6jmGWawB1XDMO0EcoHInh46qYGFZWaguPilc3aI6AQeZts84HiFjekW1G/shQ J+hLlmu7cqRDiygemTxylmpEF3zRBNiH5Cbvf3L3vpNgWrTDs36ESwsz8FsoElsdDJ twnAtsWteqVHZTkf7SkYE2we7Woqalu7IWx2e9YciN32PnJCaSVB1Ptf4W/C4sPVBw 22RPDkRKi84p0Lplg/L/fvqNR4TTWzh8a5O9u+8Q92aQ7q1NNmW/hIwkArv8mZjYCf U5+GlRG+HDTcM9uxMJg6uLbo1+PLK1h6siLmzq/c55awjgtIaOB491U7D7vl1rrCZn JuRcXUdyQxW3w== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D05F6C77B7F; Fri, 27 Jun 2025 15:00:20 +0000 (UTC) From: =?utf-8?q?Nuno_S=C3=A1_via_B4_Relay?= Date: Fri, 27 Jun 2025 16:00:20 +0100 Subject: [PATCH RESEND 2/4] dma: dma-axi-dmac: fix HW scatter-gather not looking at the queue Precedence: bulk X-Mailing-List: dmaengine@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20250627-dev-axi-dmac-fixes-v1-2-2453674c5b78@analog.com> References: <20250627-dev-axi-dmac-fixes-v1-0-2453674c5b78@analog.com> In-Reply-To: <20250627-dev-axi-dmac-fixes-v1-0-2453674c5b78@analog.com> To: dmaengine@vger.kernel.org Cc: Paul Cercueil , Lars-Peter Clausen , Vinod Koul X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1751036430; l=1232; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=VnP62GBHna2SYg1YsUNFGvTHFdm1Tb7CGDCA6I3LeD4=; b=Y0BZ4/XMUGjxSwYJ8vDomseFkr2XLowp9EMEmTTuPljLU6pZLtzw5fxhFrAOkiJDS0i97eYgX 6K5uXiOOEWQDugobn3qitlfTK8HlAsF06D3Dja9hvPnww+0IXd8FPno X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-Endpoint-Received: by B4 Relay for nuno.sa@analog.com/20231116 with auth_id=100 X-Original-From: =?utf-8?q?Nuno_S=C3=A1?= Reply-To: nuno.sa@analog.com From: Nuno Sá For HW scatter gather transfers we still need to look for the queue. The HW is capable of queueing 3 concurrent transfers and if we try more than that we'll get the submit queue full and should return. Otherwise, if we go ahead and program the new transfer, we end up discarding it. Fixes: e97dc7435972 ("dmaengine: axi-dmac: Add support for scatter-gather transfers") Signed-off-by: Nuno Sá --- drivers/dma/dma-axi-dmac.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 2aa06f66624ba5749e7e7f24b55416f96064b82f..47d95d2d743b1b939ed0ec79ee29763843bcdc09 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -233,11 +233,9 @@ static void axi_dmac_start_transfer(struct axi_dmac_chan *chan) unsigned int flags = 0; unsigned int val; - if (!chan->hw_sg) { - val = axi_dmac_read(dmac, AXI_DMAC_REG_START_TRANSFER); - if (val) /* Queue is full, wait for the next SOT IRQ */ - return; - } + val = axi_dmac_read(dmac, AXI_DMAC_REG_START_TRANSFER); + if (val) /* Queue is full, wait for the next SOT IRQ */ + return; desc = chan->next_desc; -- 2.49.0