All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: daniel@zonque.org, Misael Lopez Cruz <misael.lopez@ti.com>,
	Jyri Sarha <jsarha@ti.com>, Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH 6/6] ASoC: davinci-mcasp: Add overrun/underrun event handling
Date: Tue, 11 Nov 2014 09:47:29 +0200	[thread overview]
Message-ID: <5461BF11.7050506@ti.com> (raw)
In-Reply-To: <20141110185814.GE3815@sirena.org.uk>

On 11/10/2014 08:58 PM, Mark Brown wrote:
> 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.

The setup code only enable interrupt generation for XUNDRN for tx or ROVRN for
rx. If we receive the interrupt it is because either of these happened.
We are not yet interested on the other bits in the status register and not all
bits are signaling error.
If for example an XSYNCERR happens, we will not know about it till to point we
have XUNDRN, which is going to trigger the interrupt.
If we would have prints for other bits, we should have at least strategy to
deal with them.
At the end of the function we ack the interrupt to the HW.
Most probably we are going to handle more events, but right now we only care
about under or overruns.

-- 
Péter

  reply	other threads:[~2014-11-11  7:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 10:32 [PATCH 0/6] ASoC: davinci-mcasp: fixes and over/underrun handling Peter Ujfalusi
2014-11-10 10:32 ` [PATCH 1/6] ASoC: davinci-mcasp: Validate tdm_slots parameter at probe time Peter Ujfalusi
2014-11-10 15:00   ` Mark Brown
2014-11-10 10:32 ` [PATCH 2/6] ASoC: davinci-mcasp: Place constraint on number of channels Peter Ujfalusi
2014-11-10 15:00   ` Mark Brown
2014-11-10 10:32 ` [PATCH 3/6] ASoC: davinci-mcasp: Active slots depend on active serializers Peter Ujfalusi
2014-11-10 15:00   ` Mark Brown
2014-11-10 10:32 ` [PATCH 4/6] ASoC: davinci-mcasp: Symmetric sample bits for IIS mode Peter Ujfalusi
2014-11-10 14:55   ` Mark Brown
2014-11-10 10:32 ` [PATCH 5/6] ASoC: davinci-mcasp: Fix rx format when more bclk is used on the bus Peter Ujfalusi
2014-11-10 14:56   ` Mark Brown
2014-11-10 10:32 ` [PATCH 6/6] ASoC: davinci-mcasp: Add overrun/underrun event handling Peter Ujfalusi
2014-11-10 18:58   ` Mark Brown
2014-11-11  7:47     ` Peter Ujfalusi [this message]
2014-11-11 11:02       ` 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=5461BF11.7050506@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=daniel@zonque.org \
    --cc=jsarha@ti.com \
    --cc=lgirdwood@gmail.com \
    --cc=misael.lopez@ti.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 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.