linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lori Hikichi <lhikichi@broadcom.com>
To: Mark Brown <broonie@kernel.org>
Cc: Scott Branden <sbranden@broadcom.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<bcm-kernel-feedback-list@broadcom.com>,
	Dmitry Torokhov <dtor@google.com>,
	Anatol Pomazao <anatol@google.com>, <abrestic@google.com>,
	<bryeung@google.com>, <olofj@google.com>, <pwestin@google.com>
Subject: Re: [PATCH 2/2] ASoC: add core audio driver for Broadcom Cygnus SOC.
Date: Tue, 7 Apr 2015 19:30:57 -0700	[thread overview]
Message-ID: <552492E1.3050207@broadcom.com> (raw)
In-Reply-To: <20150406161939.GJ6023@sirena.org.uk>



On 15-04-06 09:19 AM, Mark Brown wrote:
> On Thu, Apr 02, 2015 at 11:47:18AM -0700, Lori Hikichi wrote:
>> On 15-03-30 11:42 PM, Mark Brown wrote:
>
>>>> +config SND_SOC_CYGNUS
>>>> +	tristate "SoC platform audio for Broadcom Cygnus chips"
>>>> +	depends on ARCH_BCM_CYGNUS || COMPILE_TEST
>>>> +	default ARCH_BCM_CYGNUS
>
>> Okay.
>
> You don't need to reply to every single comment, the general assumption
> will be that if there's no other followup all review comments will be
> addressed.  It's better to just reply to things where there's something
> more detailed to say, if you explicitly reply to everything then that
> makes it easier for actual replies to be missed since there's a lot of
> there's a lot of the mail that's just going to be skipped through.
>
>>>> +static void ringbuf_inc(void __iomem *audio_io, bool is_playback,
>>>> +			const struct ringbuf_regs *p_rbuf)
>
>>> So it looks like we're getting an interrupt per period and we have to
>>> manually advance to the next one?
>
>> Yes.
>
> OK, so that seems fragile - what happens if we're slightly late
> processing an interrupt or miss one entirely?  Most hardware has some
> way to read back the current position which tends to be more reliable,
> is that not an option here?
>
The hardware updates a read pointer (rdaddr) which we feed to ALSA via 
the ".pointer" hook. So yes, the hardware does have a register that 
tells us its progress.  This routine (ringbuf_inc) actually updates a 
write pointer (wraddr) which is a misnomer.  The write pointer doesn’t 
actually tell us where we are writing to – ALSA keeps track of that. 
The wraddr only prevents the hardware from reading past it.  We just use 
it, along with a low water mark configuration register, to keep the 
periodic interrupts firing.  The hardware is tracking the distance 
between rdaddr and wraddr and comparing that to the low water mark.

Being late processing the interrupt is okay since there are more samples 
to read.  That is, it was only a low water mark interrupt and we have 
one period of valid data still (we configure low water to be one 
period).  Missing an interrupt is okay since the hardware will just stop 
reading from the ring buffer when rdaddr has hit wraddr.

  reply	other threads:[~2015-04-08  2:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31  3:16 [PATCH 0/2] Cygnus Audio Driver Scott Branden
2015-03-31  3:16 ` [PATCH 1/2] ASoC: cygnus-audio: adding device tree bindings Scott Branden
2015-03-31  5:58   ` Mark Brown
2015-04-02 18:47     ` Lori Hikichi
2015-03-31  7:00   ` Mark Brown
2015-03-31  7:26   ` [alsa-devel] " Lars-Peter Clausen
2015-04-02 22:44     ` Lori Hikichi
2015-03-31  3:16 ` [PATCH 2/2] ASoC: add core audio driver for Broadcom Cygnus SOC Scott Branden
2015-03-31  6:42   ` Mark Brown
2015-04-02 18:47     ` Lori Hikichi
2015-04-06 16:19       ` Mark Brown
2015-04-08  2:30         ` Lori Hikichi [this message]
2015-04-08 19:23           ` Mark Brown
2015-04-10  2:06             ` Lori Hikichi
2015-03-31  6:43 ` [PATCH 0/2] Cygnus Audio Driver Mark Brown
2015-04-03 19:33   ` Scott Branden
2015-04-06  9:58     ` Mark Brown
2015-04-08  2:28       ` Lori Hikichi
2015-04-08 18:54         ` Mark Brown
2015-04-11  3:06           ` Lori Hikichi

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=552492E1.3050207@broadcom.com \
    --to=lhikichi@broadcom.com \
    --cc=abrestic@google.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=anatol@google.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=broonie@kernel.org \
    --cc=bryeung@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dtor@google.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=olofj@google.com \
    --cc=pawel.moll@arm.com \
    --cc=perex@perex.cz \
    --cc=pwestin@google.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=tiwai@suse.de \
    /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).