From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: ext Stephen Warren <swarren@nvidia.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 3/7] ASoC: tegra: Add tegra-pcm driver
Date: Tue, 11 Jan 2011 09:59:00 +0200 [thread overview]
Message-ID: <4D2C0DC4.4000405@nokia.com> (raw)
In-Reply-To: <1294464977-25814-4-git-send-email-swarren@nvidia.com>
On 01/08/11 07:36, ext Stephen Warren wrote:
> This provides an ASoC platform driver that manages Tegra's APB DMA
> controller.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> sound/soc/tegra/tegra_pcm.c | 401 +++++++++++++++++++++++++++++++++++++++++++
> sound/soc/tegra/tegra_pcm.h | 55 ++++++
> 2 files changed, 456 insertions(+), 0 deletions(-)
> create mode 100644 sound/soc/tegra/tegra_pcm.c
> create mode 100644 sound/soc/tegra/tegra_pcm.h
>
> diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c
...
> + switch (cmd) {
> + case SNDRV_PCM_TRIGGER_START:
> + prtd->dma_pos = 0;
> + prtd->dma_pos_end = frames_to_bytes(runtime, runtime->periods * runtime->period_size);
> + prtd->period_index = 0;
> + prtd->dma_req_idx = 0;
> + /* Fall-through */
> + case SNDRV_PCM_TRIGGER_RESUME:
> + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> + spin_lock_irqsave(&prtd->lock, flags);
> + prtd->running = 1;
> + spin_unlock_irqrestore(&prtd->lock, flags);
> + tegra_pcm_queue_dma(prtd);
> + tegra_pcm_queue_dma(prtd);
> + break;
> + case SNDRV_PCM_TRIGGER_STOP:
> + case SNDRV_PCM_TRIGGER_SUSPEND:
> + case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> + spin_lock_irqsave(&prtd->lock, flags);
> + prtd->running = 0;
> + spin_unlock_irqrestore(&prtd->lock, flags);
> + tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[0]);
> + tegra_dma_dequeue_req(prtd->dma_chan, &prtd->dma_req[1]);
Does tegra_dma_dequeue_req stops the ongoing DMA transaction as well?
If I read the code right, you have two DMA requests placed at every
given time (one is currently running, the other is waiting).
What happens if the dma_req[0] was running, and you dequeue it? Will the
DMA engine moves to process the dma_req[1], which will be stopped a
moment later?
--
Péter
next prev parent reply other threads:[~2011-01-11 7:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1294450353-25076-1-git-send-email-swarren@wwwdotorg.org>
2011-01-08 5:36 ` [PATCH 0/7] Tegra ALSA/ASoC driver Stephen Warren
2011-01-08 5:36 ` [PATCH 1/7] ASoC: Export debugfs root dentry Stephen Warren
2011-01-10 11:57 ` Mark Brown
2011-01-08 5:36 ` [PATCH 2/7] ASoC: tegra: Add tegra-das driver Stephen Warren
2011-01-08 5:36 ` [PATCH 3/7] ASoC: tegra: Add tegra-pcm driver Stephen Warren
2011-01-11 7:59 ` Peter Ujfalusi [this message]
2011-01-11 16:34 ` Stephen Warren
2011-01-08 5:36 ` [PATCH 4/7] ASoC: tegra: Add tegra-i2s driver Stephen Warren
2011-01-08 5:36 ` [PATCH 5/7] ASoC: tegra: Machine utility code Stephen Warren
2011-01-08 5:36 ` [PATCH 6/7] ASoC: tegra: Harmony machine support Stephen Warren
2011-01-08 5:36 ` [PATCH 7/7] ASoC: tegra: Kconfig and Makefile Stephen Warren
2011-01-09 13:59 ` [PATCH 0/7] Tegra ALSA/ASoC driver Mark Brown
2011-01-10 18:35 ` Mark Brown
2011-01-10 21:47 ` Liam Girdwood
2011-01-10 22:27 ` Mark Brown
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=4D2C0DC4.4000405@nokia.com \
--to=peter.ujfalusi@nokia.com \
--cc=alsa-devel@alsa-project.org \
--cc=swarren@nvidia.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;
as well as URLs for NNTP newsgroup(s).