public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Rahul Navale <rahulnavale04@gmail.com>
To: dmaengine@vger.kernel.org
Cc: vkoul@kernel.org, michal.simek@amd.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	thomas.gessler@brueckmann-gmbh.de, radhey.shyam.pandey@amd.com,
	Suraj.Gupta2@amd.com, marex@denx.de,
	manivannan.sadhasivam@linaro.org, harini.katakam@amd.com,
	marex@nabladev.com, Rahul Navale <rahul.navale@ifm.com>
Subject: [RFC PATCH] dmaengine: xilinx_dma: device-wide directions cause ASoC cyclic DMA regression
Date: Wed, 11 Feb 2026 19:30:51 +0530	[thread overview]
Message-ID: <20260211140051.8177-1-rahulnavale04@gmail.com> (raw)

From: Rahul Navale <rahul.navale@ifm.com>

On ZynqMP platforms using AXI DMA for ASoC PCM playback, upstream commit
7e01511443c3 ("dmaengine: xilinx_dma: Set dma_device directions") causes
cyclic playback to fail after the first buffer period.

Background:
The upstream patch adds the following line in xilinx_dma_chan_probe():

    xdev->common.directions |= chan->direction;

Its purpose is to coalesce the directions of all enabled TX/RX channels into
the device-wide dma_device.directions mask so that dma_get_slave_caps()
works correctly. This is required by users such as IIO DMAEngine buffers
that rely on device-wide capability reporting.

Problem on ZynqMP ASoC audio (PCM):
On ZynqMP, Xilinx DMA provides fixed-direction channels:

    MM2S channels -> DMA_MEM_TO_DEV
    S2MM channels -> DMA_DEV_TO_MEM

ASoC dmaengine PCM relies on these fixed directions to select proper DMA
channels for cyclic playback and capture. Aggregating directions device-wide
can cause inconsistent capability reporting depending on channel probe order
or device tree layout.

This leads to the following behavior:
- The first DMA buffer plays correctly.
- Subsequent DMA periods repeat the first period indefinitely, breaking
  cyclic playback.

A temporary local patch that removes:

    xdev->common.directions |= chan->direction;

restores audio playback on ZynqMP platforms.

This RFC patch is a workaround to demonstrate a ZynqMP ASoC cyclic PCM
regression that appears in v6.12.36+ (backport of 7e01511443c3).

The workaround restores PCM playback but may regress users relying on
dma_get_slave_caps() (e.g. IIO DMAEngine buffers). The goal is to start
discussion on the correct upstream fix that supports both ASoC PCM and IIO.

Fixes: 7e01511443c3 ("dmaengine: xilinx_dma: Set dma_device directions")
Signed-off-by: Rahul Navale <rahul.navale@ifm.com>
---
 drivers/dma/xilinx/xilinx_dma.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index aff046b03ef7..8da86e322c7a 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -2938,8 +2938,6 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
 		return -EINVAL;
 	}
 
-	xdev->common.directions |= chan->direction;
-
 	/* Request the interrupt */
 	chan->irq = of_irq_get(node, chan->tdest);
 	if (chan->irq < 0)
-- 
2.34.1



             reply	other threads:[~2026-02-11 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-11 14:00 Rahul Navale [this message]
2026-02-15 21:47 ` [RFC PATCH] dmaengine: xilinx_dma: device-wide directions cause ASoC cyclic DMA regression Folker Schwesinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260211140051.8177-1-rahulnavale04@gmail.com \
    --to=rahulnavale04@gmail.com \
    --cc=Suraj.Gupta2@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=harini.katakam@amd.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=marex@denx.de \
    --cc=marex@nabladev.com \
    --cc=michal.simek@amd.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=rahul.navale@ifm.com \
    --cc=thomas.gessler@brueckmann-gmbh.de \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox