From: Frank Li <Frank.li@nxp.com>
To: Shengjiu Wang <shengjiu.wang@nxp.com>
Cc: lgirdwood@gmail.com, broonie@kernel.org, robh@kernel.org,
krzk+dt@kernel.org, conor+dt@kernel.org, shawnguo@kernel.org,
s.hauer@pengutronix.de, kernel@pengutronix.de,
festevam@gmail.com, linux-sound@vger.kernel.org,
devicetree@vger.kernel.org, imx@lists.linux.dev,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, shengjiu.wang@gmail.com,
Xiubo.Lee@gmail.com, nicoleotsuka@gmail.com, perex@perex.cz,
tiwai@suse.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/3] ASoC: fsl_asrc: Add support for i.MX952 platform
Date: Thu, 29 Jan 2026 12:14:06 -0500 [thread overview]
Message-ID: <aXuVXruPir7hasdd@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260128071853.2602784-3-shengjiu.wang@nxp.com>
On Wed, Jan 28, 2026 at 03:18:52PM +0800, Shengjiu Wang wrote:
> Add a compatible string and clock mapping table to support ASRC on the
> i.MX952 platform.
>
> There is a limitation on i.MX952 that dma request is not cleared at the
> end of conversion with dma slave mode. Which causes sample is dropped
> from the input fifo on the second time if dma is triggered before the
> client device and EDMA may copy wrong data from output fifo as the output
> fifo is not ready in the beginning.
>
> So need to trigger asrc before dma on i.MX952, and add delay to wait
> output data is generated then start the EDMA for output, otherwise the
> m2m function has noise issues.
>
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> ---
> sound/soc/fsl/fsl_asrc.c | 39 +++++++++++++++++++++++++++++++++
> sound/soc/fsl/fsl_asrc.h | 16 ++++++++++++++
> sound/soc/fsl/fsl_asrc_common.h | 3 +++
> sound/soc/fsl/fsl_asrc_m2m.c | 29 +++++++++++++++++-------
> 4 files changed, 79 insertions(+), 8 deletions(-)
>
...
> diff --git a/sound/soc/fsl/fsl_asrc_m2m.c b/sound/soc/fsl/fsl_asrc_m2m.c
> index f46881f71e43..296e13a16490 100644
> --- a/sound/soc/fsl/fsl_asrc_m2m.c
> +++ b/sound/soc/fsl/fsl_asrc_m2m.c
> @@ -253,15 +253,28 @@ static int asrc_m2m_device_run(struct fsl_asrc_pair *pair, struct snd_compr_task
> reinit_completion(&pair->complete[IN]);
> reinit_completion(&pair->complete[OUT]);
>
> - /* Submit DMA request */
> - dmaengine_submit(pair->desc[IN]);
> - dma_async_issue_pending(pair->desc[IN]->chan);
> - if (out_dma_len > 0) {
> - dmaengine_submit(pair->desc[OUT]);
> - dma_async_issue_pending(pair->desc[OUT]->chan);
> - }
> + if (asrc->start_before_dma) {
> + asrc->m2m_start(pair);
Does other Soc also work if ASRC start before DMA enable? Suppose most like
work. Then needn't start_before_dma.
Frank
> + /* Submit DMA request */
> + dmaengine_submit(pair->desc[IN]);
> + dma_async_issue_pending(pair->desc[IN]->chan);
> + if (out_dma_len > 0) {
> + if (asrc->m2m_output_ready)
> + asrc->m2m_output_ready(pair);
> + dmaengine_submit(pair->desc[OUT]);
> + dma_async_issue_pending(pair->desc[OUT]->chan);
> + }
> + } else {
> + /* Submit DMA request */
> + dmaengine_submit(pair->desc[IN]);
> + dma_async_issue_pending(pair->desc[IN]->chan);
> + if (out_dma_len > 0) {
> + dmaengine_submit(pair->desc[OUT]);
> + dma_async_issue_pending(pair->desc[OUT]->chan);
> + }
>
> - asrc->m2m_start(pair);
> + asrc->m2m_start(pair);
> + }
>
> if (!wait_for_completion_interruptible_timeout(&pair->complete[IN], 10 * HZ)) {
> dev_err(dev, "out DMA task timeout\n");
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-01-29 17:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 7:18 [PATCH 0/3] ASoC: fsl_asrc: support the i.MX952 platform Shengjiu Wang
2026-01-28 7:18 ` [PATCH 1/3] ASoC: dt-bindings: fsl,imx-asrc: Add support for " Shengjiu Wang
2026-01-28 11:46 ` Krzysztof Kozlowski
2026-01-29 2:07 ` Shengjiu Wang
2026-01-28 7:18 ` [PATCH 2/3] ASoC: fsl_asrc: " Shengjiu Wang
2026-01-29 9:20 ` Daniel Baluta
2026-01-29 9:53 ` Shengjiu Wang
2026-01-29 17:14 ` Frank Li [this message]
2026-01-30 1:44 ` Shengjiu Wang
2026-01-28 7:18 ` [PATCH 3/3] ASoC: fsl_asrc_dma: allocate memory from dma device Shengjiu Wang
2026-01-29 9:25 ` Daniel Baluta
2026-01-29 9:37 ` Shengjiu Wang
2026-01-29 17:09 ` Frank Li
2026-01-30 1:52 ` Shengjiu Wang
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=aXuVXruPir7hasdd@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=Xiubo.Lee@gmail.com \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nicoleotsuka@gmail.com \
--cc=perex@perex.cz \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=shengjiu.wang@gmail.com \
--cc=shengjiu.wang@nxp.com \
--cc=tiwai@suse.com \
/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