[alsa-devel] [PATCH 6/6] ASoC: davinci-mcasp: Add overrun/underrun event handling

Mark Brown broonie at kernel.org
Mon Nov 10 19:58:14 CET 2014


On Mon, Nov 10, 2014 at 12:32:20PM +0200, Peter Ujfalusi wrote:

> +	stat = mcasp_get_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG);
> +	if (stat & XUNDRN) {
> +		dev_warn(mcasp->dev, "Transmit buffer underflow\n");
> +		substream = mcasp->substreams[SNDRV_PCM_STREAM_PLAYBACK];
> +		if (substream) {
> +			snd_pcm_stream_lock_irq(substream);
> +			if (snd_pcm_running(substream))
> +				snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
> +			snd_pcm_stream_unlock_irq(substream);
> +		}
> +	}
> +
> +	mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, stat);
> +
> +	return IRQ_HANDLED;

This will unconditionally report that any interrupt that gets delivered
is handled and acknowledged regardles of what was reported.  This isn't
ideal, I'd at least expect a warning to be printed if we're handling
interrupts we don't understand.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20141110/49a1f9cf/attachment.sig>


More information about the Alsa-devel mailing list