All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: ASoC V2: report error if DMA doesn't start in FSL MPC8610 sound drivers
@ 2008-08-07 16:22 Timur Tabi
  2008-08-07 16:22 ` [PATCH] ALSA: ASoC V2: disable automatic volume control in the CS4270 sound driver Timur Tabi
  0 siblings, 1 reply; 7+ messages in thread
From: Timur Tabi @ 2008-08-07 16:22 UTC (permalink / raw)
  To: alsa-devel, broonie, lg

Return an error if the DMA's current pointer is not within the bounds of the
DMA buffer.  This can happen if the DMA controller is not programmed correctly,
or if the SSI doesn't communicate with the DMA controller correctly.

Signed-off-by: Timur Tabi <timur@freescale.com>
---

This patch is for ASoC V2.

 sound/soc/fsl/fsl_dma.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
index cb1e5ae..b4ae486 100644
--- a/sound/soc/fsl/fsl_dma.c
+++ b/sound/soc/fsl/fsl_dma.c
@@ -689,6 +689,15 @@ static snd_pcm_uframes_t fsl_dma_pointer(struct snd_pcm_substream *substream)
 	else
 		position = in_be32(&dma_channel->dar);
 
+	if ((position < dma_private->dma_buf_phys) ||
+	    (position > dma_private->dma_buf_end)) {
+		dev_err(substream->pcm->card->dev,
+			"DMA(%u,%u) pointer is out of range, halting stream\n",
+			dma_private->dma_info->controller_id,
+			dma_private->dma_info->channel_id);
+		return SNDRV_PCM_POS_XRUN;
+	}
+
 	frames = bytes_to_frames(runtime, position - dma_private->dma_buf_phys);
 
 	/*
-- 
1.5.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-08-23 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07 16:22 [PATCH] ALSA: ASoC V2: report error if DMA doesn't start in FSL MPC8610 sound drivers Timur Tabi
2008-08-07 16:22 ` [PATCH] ALSA: ASoC V2: disable automatic volume control in the CS4270 sound driver Timur Tabi
2008-08-07 16:22   ` [PATCH] ALSA: ASoC V2: trim SSI sysfs statistics in Freescale MPC8610 sound drivers Timur Tabi
2008-08-08 10:54   ` [PATCH] ALSA: ASoC V2: disable automatic volume control in the CS4270 sound driver Mark Brown
2008-08-08 15:03     ` Timur Tabi
2008-08-22 21:18   ` Timur Tabi
2008-08-23 13:39     ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.