From nobody Fri Dec 19 10:56:12 2025 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 3F83C32B9B7; Tue, 4 Nov 2025 16:21:51 +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=1762273311; cv=none; b=O6s+ipMarHalwQV7amDcNGp4hMq7wuvoWHv50Zez3fpZkeDstMBHNgZItTSJ1fvy9tBZtzCH8I3epc5ccyK5J7RYS4AqYX8PUV2nu12cylCk/fLFjCHydPf/1ovd/w8IrrRLQzcrsskoPVD9kgz5e1NbGI+S1S1ORILMBqQghvY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762273311; c=relaxed/simple; bh=NNOWTT+YB33V66bWp09LBKeawoo4s/jO0mOdabh4dGU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iXXS8TexFi9yvj/wpZwT27x9doGrQWWzbr1O2IzLh+bRtVsOxQairHLn4JV//4wK/L5QHX0eZMkdXPZWHLo6qET8GVNqMad4VHKH/4T2Vn3T0H0K18URY74CHFQV0d7JERrp1J+aXR38ZtBtc7tcxAhaK7iJaAk7YGkdPPsVXuI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mUE7FMtM; 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="mUE7FMtM" Received: by smtp.kernel.org (Postfix) with ESMTPS id E4924C4CEF7; Tue, 4 Nov 2025 16:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762273311; bh=NNOWTT+YB33V66bWp09LBKeawoo4s/jO0mOdabh4dGU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=mUE7FMtMjFTOm9XluIoJ6vlsgzWhMINtW9DmgEDq2Bigk+w817tSDs5wBsGtrAijo Z3TJplY+BtArGPpSCoqvtshxEARhNwJ83bOHiXyM0YeFTghh9uvum8zV5SIpteEyt2 1eZEHHdAq8UwmGQOxBXflucSEkmg6DEiOPTWI6XrUN2II1FWzn0o4/cAX5VX6VTed2 uyXSB8mKqhT/mXbofr+0hhsVPIQjU7H66UJNg6r67+lZ1YLmMi/ceA6FPIW0FoVETd 7b6C4OTet/MxkNx+FzD5k5sGAaq6I1rSfKX/5m5/vDibIc2pxPSNyiogQadZifAEBy Bav3pXdas/dBw== 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 D9AA8CCFA07; Tue, 4 Nov 2025 16:21:50 +0000 (UTC) From: =?utf-8?q?Nuno_S=C3=A1_via_B4_Relay?= Date: Tue, 04 Nov 2025 16:22:25 +0000 Subject: [PATCH RESEND 1/4] dma: dma-axi-dmac: fix SW cyclic transfers Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-axi-dmac-fixes-and-improvs-v1-1-3e6fd9328f72@analog.com> References: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> In-Reply-To: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> To: Vinod Koul , Lars-Peter Clausen , Paul Cercueil Cc: Michael Hennerich , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762273346; l=1405; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=h38Cp593uwl9c1SEt5NsKQomiYALx/d39utsfA9eGW4=; b=E2NgXxn7aKyCrbUdCy9amZZSWcULFuBhnycTQ9SxCbWHr/B1fmdCY4fOBik6A5zm+vY494NCk k8JjsdA6fF5CiSnhQKkn9bEs7cqFqRRAHNQ7fcJLP66/KCqByBuDOMO 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=C3=A1 If 'hw_cyclic' is false we should still be able to do cyclic transfers in "software". That was not working for the case where 'desc->num_sgs' is 1 because 'chan->next_desc' is never set with the current desc which means that the cyclic transfer only runs once and in the next SOT interrupt we do nothing since vchan_next_desc() will return NULL. Fix it by setting 'chan->next_desc' as soon as we get a new desc via vchan_next_desc(). Fixes: 0e3b67b348b8 ("dmaengine: Add support for the Analog Devices AXI-DMA= C DMA controller") Signed-off-by: Nuno S=C3=A1 --- drivers/dma/dma-axi-dmac.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 5b06b0dc67ee..e22639822045 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -247,6 +247,7 @@ static void axi_dmac_start_transfer(struct axi_dmac_cha= n *chan) return; list_move_tail(&vdesc->node, &chan->active_descs); desc =3D to_axi_dmac_desc(vdesc); + chan->next_desc =3D desc; } sg =3D &desc->sg[desc->num_submitted]; =20 @@ -265,8 +266,6 @@ static void axi_dmac_start_transfer(struct axi_dmac_cha= n *chan) else chan->next_desc =3D NULL; flags |=3D AXI_DMAC_FLAG_LAST; - } else { - chan->next_desc =3D desc; } =20 sg->hw->id =3D axi_dmac_read(dmac, AXI_DMAC_REG_TRANSFER_ID); --=20 2.51.0 From nobody Fri Dec 19 10:56:12 2025 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 4A70432D0C8; Tue, 4 Nov 2025 16:21:51 +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=1762273311; cv=none; b=H1L9dmglXWSHtVI4wTBklP9On4RB9PlOzopKUPfdqARjEakrZ4XYFaurTNtBrblCvCLt8eIvcnmtre3vRJAvDfBG9+Ab51CIouF24elHuYle7kHWERLRUOvtnVb3QPCQ2li3PJWRXHr+nAOFPFhlpYUVQutfo8G7352USfJTOeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762273311; c=relaxed/simple; bh=cV2vC+hxvYQWbjTcpngorrmuYzWYeh/aFndPXKB73hg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eqqI0MbEhDkA6s6w18Ld/ubZxIi5Ato6kaPZ0dUGgMJKFThKSaFR8QCof6RMrwPJzYbAGc4iwZHlEi6KyZTYFzcIy5VDYGjMYVRV1gEaULOgouHimNZWTJSCH+5A7CuYkxUlkXxjhdRV95ZVNm6qu29U7xSXjN3VzSeCkS+GjnY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K4P2hCDz; 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="K4P2hCDz" Received: by smtp.kernel.org (Postfix) with ESMTPS id F3B8FC16AAE; Tue, 4 Nov 2025 16:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762273311; bh=cV2vC+hxvYQWbjTcpngorrmuYzWYeh/aFndPXKB73hg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=K4P2hCDzrPQBH+VFqU9CUQyQvGeSqXAiG3/0PLLgEE4UKT/Fq9QG+d80Og2+bpuS+ 3V5DvnjbkHF4WhFjXLz9ziCmB1Ef6pkshaVVYPiwdWboskMPQveJndlkCq/qYTx8py E+D1UosTg7/iYtwOoRT0uHORiyLEWMXe3cqm1nEeJR+PIR6H9OhUNN0S9MwCD73vfD yqoSg5D3IMhrz67meMZW7i9JWOSJsZdk1Q/dz+a0UGhXTvx0D2vx6ObHKZppa3xbq7 A8IMd3GwNnk27G6qM/T/g4NNlRqntTKOEhCCGfsvpje3MEfxWDuNBBxmJ7aRcNdPdW esIRkFcUAxD9A== 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 E74B9CCF9E3; Tue, 4 Nov 2025 16:21:50 +0000 (UTC) From: =?utf-8?q?Nuno_S=C3=A1_via_B4_Relay?= Date: Tue, 04 Nov 2025 16:22:26 +0000 Subject: [PATCH RESEND 2/4] dma: dma-axi-dmac: fix HW scatter-gather not looking at the queue Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-axi-dmac-fixes-and-improvs-v1-2-3e6fd9328f72@analog.com> References: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> In-Reply-To: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> To: Vinod Koul , Lars-Peter Clausen , Paul Cercueil Cc: Michael Hennerich , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762273346; l=1176; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=t6kHiNCcPdNevKJZVwwd/Ae6Ss9wsGbaY4aAg+0KubQ=; b=iSHU+bVnMQxJm1vUTgWhFYcxzXNZpc9drBk0pcRZYkUjkn3V+vnFujnRPJhSHOL1jnRphyA2v 1Oo6i1ldXUgBsvMuDAeSgO2k+SkMBcfFD7YksHv0Nbfmq9UjfloCJoQ 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=C3=A1 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 t= ransfers") Signed-off-by: Nuno S=C3=A1 --- 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 e22639822045..0f25f6d8ae71 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_ch= an *chan) unsigned int flags =3D 0; unsigned int val; =20 - if (!chan->hw_sg) { - val =3D axi_dmac_read(dmac, AXI_DMAC_REG_START_TRANSFER); - if (val) /* Queue is full, wait for the next SOT IRQ */ - return; - } + val =3D axi_dmac_read(dmac, AXI_DMAC_REG_START_TRANSFER); + if (val) /* Queue is full, wait for the next SOT IRQ */ + return; =20 desc =3D chan->next_desc; =20 --=20 2.51.0 From nobody Fri Dec 19 10:56:12 2025 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 4A77D32D445; Tue, 4 Nov 2025 16:21:51 +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=1762273311; cv=none; b=JXL5jqUAwiMjvWMU9hqEhA113Mvem6JahQ55dwtRdsdB+PAvuCdcLVEWhB1WPvE6Z94SobQbJeNOuoGYnWpdueE8njw32uc4isoijQiz/SWt1qaQMRe0bhwT3gYCpxDTBDPUvJT958pBV0Rl6r8KDUIljJMTwa2nvzk2TAOClu0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762273311; c=relaxed/simple; bh=YPk3JK/czaWZUGcpNoFEPzOWkVnbmChmWzU8IRwb0JE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Vn6JFV1OgaUXoJzkgGxSh5/F4anoa+KQRVxXVxDTkCz6S4foye8y+k40yTnzf0kea1c98jXL8y1zUv+1DM8jn6vYai6A2DagDb5FdVAk3W4lkUCx2WwSxP2XunfrSetALTDFx0xD01xpmI+RXEmZHQC/TunTp1dk4jagRHvRDaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rni8PeCT; 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="Rni8PeCT" Received: by smtp.kernel.org (Postfix) with ESMTPS id 09B2BC19422; Tue, 4 Nov 2025 16:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762273311; bh=YPk3JK/czaWZUGcpNoFEPzOWkVnbmChmWzU8IRwb0JE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Rni8PeCTtTL5JA2LqwqA1WblMsv02Ck3Zl6npPqhEfFoK5XdWPIIuRqsZmWBnU3yB 27HaF5nL4WhXF7IFPgSH+Hilvyket5bQJ8LU8+2AwUfqTeHqyjzt6Sif05zozEMG87 KX0VnrWmSKXw1niNwX3BQWWC2h+7OT3fQZsdXvKj/vuRQCA3AxUS10PJL/rqt5uR2+ N0wc5ADEYeU13fR9oCPqR98vM09ErLENzV5lXeVkOPxOAwqDF05cja8g5CKbX6zckP pMwo/1YYb1Brt/Ot8dLbUlvL+EsER+BlryNPGxpJfm9EiTyjyD22ppi2AY09tTwHYy iZM671/Ai/LoQ== 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 01AF3CCFA13; Tue, 4 Nov 2025 16:21:51 +0000 (UTC) From: =?utf-8?q?Nuno_S=C3=A1_via_B4_Relay?= Date: Tue, 04 Nov 2025 16:22:27 +0000 Subject: [PATCH RESEND 3/4] dma: dma-axi-dmac: support bigger than 32bits addresses Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-axi-dmac-fixes-and-improvs-v1-3-3e6fd9328f72@analog.com> References: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> In-Reply-To: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> To: Vinod Koul , Lars-Peter Clausen , Paul Cercueil Cc: Michael Hennerich , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762273346; l=3123; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=S2/3AgaSBErULI0RSHcw3qkG62aVC+nhl7faANC0TJ0=; b=06dYRFgw0iPirSgMG1TrMM7Q2sKpSJT4EHmLx9iw1eTa9bAwHfXwGsNOP8ftOU6Sxs/u1oJsj 6F88nrc8IEJBmMI9vx6RA3iA50P5lzN1hr+7YncsD17WmPA+01P/1Hu 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=C3=A1 In some supported platforms as ARCH_ZYNQMP, part of the memory is mapped above 32bit addresses and since the DMA mask, by default, is set to 32bits, we would need to rely on swiotlb (which incurs a performance penalty) for the DMA mappings. Thus, we can write either the SRC or DEST high addresses with 1's and read them back. The last bit set on the return value will reflect the IP address bus width and so we can update the device DMA mask accordingly. While at it, support bigger that 32 bits transfers in IP without HW scatter gather support. Signed-off-by: Nuno S=C3=A1 --- drivers/dma/dma-axi-dmac.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 0f25f6d8ae71..15c569449a28 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -69,7 +69,9 @@ #define AXI_DMAC_REG_START_TRANSFER 0x408 #define AXI_DMAC_REG_FLAGS 0x40c #define AXI_DMAC_REG_DEST_ADDRESS 0x410 +#define AXI_DMAC_REG_DEST_ADDRESS_HIGH 0x490 #define AXI_DMAC_REG_SRC_ADDRESS 0x414 +#define AXI_DMAC_REG_SRC_ADDRESS_HIGH 0x494 #define AXI_DMAC_REG_X_LENGTH 0x418 #define AXI_DMAC_REG_Y_LENGTH 0x41c #define AXI_DMAC_REG_DEST_STRIDE 0x420 @@ -271,11 +273,14 @@ static void axi_dmac_start_transfer(struct axi_dmac_c= han *chan) if (!chan->hw_sg) { if (axi_dmac_dest_is_mem(chan)) { axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS, sg->hw->dest_addr); + axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS_HIGH, + sg->hw->dest_addr >> 32); axi_dmac_write(dmac, AXI_DMAC_REG_DEST_STRIDE, sg->hw->dst_stride); } =20 if (axi_dmac_src_is_mem(chan)) { axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS, sg->hw->src_addr); + axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS_HIGH, sg->hw->src_addr >>= 32); axi_dmac_write(dmac, AXI_DMAC_REG_SRC_STRIDE, sg->hw->src_stride); } } @@ -990,6 +995,9 @@ static int axi_dmac_read_chan_config(struct device *dev= , struct axi_dmac *dmac) static int axi_dmac_detect_caps(struct axi_dmac *dmac, unsigned int versio= n) { struct axi_dmac_chan *chan =3D &dmac->chan; + struct device *dev =3D dmac->dma_dev.dev; + u32 mask; + int ret; =20 axi_dmac_write(dmac, AXI_DMAC_REG_FLAGS, AXI_DMAC_FLAG_CYCLIC); if (axi_dmac_read(dmac, AXI_DMAC_REG_FLAGS) =3D=3D AXI_DMAC_FLAG_CYCLIC) @@ -1024,6 +1032,22 @@ static int axi_dmac_detect_caps(struct axi_dmac *dma= c, unsigned int version) return -ENODEV; } =20 + if (axi_dmac_dest_is_mem(chan)) { + axi_dmac_write(dmac, AXI_DMAC_REG_DEST_ADDRESS_HIGH, 0xffffffff); + mask =3D axi_dmac_read(dmac, AXI_DMAC_REG_DEST_ADDRESS_HIGH); + } else { + axi_dmac_write(dmac, AXI_DMAC_REG_SRC_ADDRESS_HIGH, 0xffffffff); + mask =3D axi_dmac_read(dmac, AXI_DMAC_REG_SRC_ADDRESS_HIGH); + } + + mask =3D 32 + fls(mask); + + ret =3D dma_set_mask_and_coherent(dev, DMA_BIT_MASK(mask)); + if (ret) { + dev_err(dev, "DMA mask set error %d\n", ret); + return ret; + } + if (version >=3D ADI_AXI_PCORE_VER(4, 2, 'a')) chan->hw_partial_xfer =3D true; =20 --=20 2.51.0 From nobody Fri Dec 19 10:56:12 2025 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 71723330B29; Tue, 4 Nov 2025 16:21:51 +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=1762273311; cv=none; b=e/n018yvlY4KVN8Q87RG2JpaHIJfKVivFf3Hau9JWTq/h7f7SWfAq4C17q9M0enrjyjyALi5Wf48swa6ZfkDGq1ANHEdyDn81H8H2FRDAkN8WoPc5HNLhK/uZ6adNyXMwX6CVj1jzCLdJYzKtIl/QO6ioLfzM3SbhLg/A0/njQs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762273311; c=relaxed/simple; bh=l28S+FPnMgtFknid2QsJQuXpj757STkW61cE7MLf4jE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=WVrM2blhFI+WsE9m/VixidMBBd1PpzkXDaCPFJswBGyNlF0h8eH6H5bbDOsarH+McI3tRzn9SjmO1j7qkEOMLXNx3yHXxTLsOpzzgyv+4gfrVbACoNrfvJJpXSRhTUeO2wvSHfT9G0OiUS2JUXYFlt4rZ1VTVLGboEM9T0tJ2Tw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pZAAWyVm; 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="pZAAWyVm" Received: by smtp.kernel.org (Postfix) with ESMTPS id 16E45C19425; Tue, 4 Nov 2025 16:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762273311; bh=l28S+FPnMgtFknid2QsJQuXpj757STkW61cE7MLf4jE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pZAAWyVm8yyj+z4LS3J7UwRoCPQVaPWfLNnBHViphbF8xJvkZE/fKVjc41pqiiBtS UcivH+I35i5Ce9Cq3vJX/OjMZWD29NbcEiriBygt0yZrPz3o5ySMYhs2t1zHQjVcOr ROGS0So1u4kGPjwCTU8tyq4Vcgp16rh8Ud5DEGCQHJ9ZXaxbkZeSniWpEWzfVsflis z4HZIOqXutNxdPteUD+Cz7Luv+hB6Sd1NhGap/9QQNdQVIoFjIbPEMyLvomjkYi66V Xb99cQzDh9+75iem5PYOIOsMb4EVzoGuljSLa974oIqn36cI1UQIPuRnIzuD07Fnug GwDsSfhI0eWVw== 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 0F5B9CCFA0C; Tue, 4 Nov 2025 16:21:51 +0000 (UTC) From: =?utf-8?q?Nuno_S=C3=A1_via_B4_Relay?= Date: Tue, 04 Nov 2025 16:22:28 +0000 Subject: [PATCH RESEND 4/4] dma: dma-axi-dmac: simplify axi_dmac_parse_dt() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251104-axi-dmac-fixes-and-improvs-v1-4-3e6fd9328f72@analog.com> References: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> In-Reply-To: <20251104-axi-dmac-fixes-and-improvs-v1-0-3e6fd9328f72@analog.com> To: Vinod Koul , Lars-Peter Clausen , Paul Cercueil Cc: Michael Hennerich , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1762273346; l=1495; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=VqRuROAKB/H4ixEVTu/qisNNBJ8vSqHNecImOOy50LM=; b=QZfch/+5WxO5rLZVSf5Qd9f4DQNZJ0eKpc9rCwtBEJ5qOzFXjJrDKXKMeh6kuD6OjIllkMUsv gzsA/SrEyfhAJY3o0AFRLWORcjArY67KvHA5UEwjHpfgbuCFf9gvRHx 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=C3=A1 Simplify axi_dmac_parse_dt() by using the cleanup device_node class for automatically releasing the of_node reference when going out of scope. Signed-off-by: Nuno S=C3=A1 --- drivers/dma/dma-axi-dmac.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 15c569449a28..045e9b9a90df 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -8,6 +8,7 @@ =20 #include #include +#include #include #include #include @@ -927,22 +928,18 @@ static int axi_dmac_parse_chan_dt(struct device_node = *of_chan, =20 static int axi_dmac_parse_dt(struct device *dev, struct axi_dmac *dmac) { - struct device_node *of_channels, *of_chan; int ret; =20 - of_channels =3D of_get_child_by_name(dev->of_node, "adi,channels"); + struct device_node *of_channels __free(device_node) =3D of_get_child_by_n= ame(dev->of_node, + "adi,channels"); if (of_channels =3D=3D NULL) return -ENODEV; =20 - for_each_child_of_node(of_channels, of_chan) { + for_each_child_of_node_scoped(of_channels, of_chan) { ret =3D axi_dmac_parse_chan_dt(of_chan, &dmac->chan); - if (ret) { - of_node_put(of_chan); - of_node_put(of_channels); + if (ret) return -EINVAL; - } } - of_node_put(of_channels); =20 return 0; } --=20 2.51.0