From: "Folker Schwesinger" <dev@folker-schwesinger.de>
To: "Rahul Navale" <rahulnavale04@gmail.com>, <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: Re: [RFC PATCH] dmaengine: xilinx_dma: device-wide directions cause ASoC cyclic DMA regression
Date: Sun, 15 Feb 2026 21:47:55 +0000 [thread overview]
Message-ID: <DGFV6UIJCQCU.3AS44T9UDTHQI@folker-schwesinger.de> (raw)
In-Reply-To: <20260211140051.8177-1-rahulnavale04@gmail.com>
Hi,
On Wed Feb 11, 2026 at 3:00 PM CET, Rahul Navale wrote:
> 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.
>
as far as I understand it, dma_device.directions lists all slave
directions the device supports across all channels. On the other hand,
dma_slave_caps.directions is a bitmask of slave directions the channel
supports.
While 7e01511443c3 ("dmaengine: xilinx_dma: Set dma_device directions")
fixed the dma_device.directions bit in Xilinx AXI DMA, it exposes
another short-coming of AXI DMA: as with the ASoC PCM, there may be DMA
engine devices with non-uniformly distributed slave capabilities per
device channels.
To adress this, there's the optional dma_device.device_caps() callback.
So I think the right way forward is to implement device_caps() for the
Xilinx AXI DMA and override dma_slave_caps.directions with the
channel-specific directions.
This should fix the issue for the ASoC PCM while preserving
functionality for the IIO DMAEngine buffer use-case.
I'm working on a patch that implements the proposed solution. I'll
post it in the next days after testing it with the IIO use case.
Unfortunately, I don't have access to a ZynqMP device, so to verify that
it actually fixes the regression in practice, I'll have to kindly ask
you, Rahul, for your feedback.
Best regards,
Folker
prev parent reply other threads:[~2026-02-15 22:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 14:00 Rahul Navale
2026-02-15 21:47 ` Folker Schwesinger [this message]
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=DGFV6UIJCQCU.3AS44T9UDTHQI@folker-schwesinger.de \
--to=dev@folker-schwesinger.de \
--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=rahulnavale04@gmail.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
all inboxes | Powered by JetHome®