From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: alsa-devel@alsa-project.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Valentin Longchamp <valentin.longchamp@epfl.ch>
Subject: Re: [PATCH 3/3] imx-ssi: Use a hrtimer in FIQ mode
Date: Thu, 08 Apr 2010 14:30:13 +0100 [thread overview]
Message-ID: <1270733413.3248.403.camel@odin> (raw)
In-Reply-To: <20100408131353.GI3688@pengutronix.de>
On Thu, 2010-04-08 at 15:13 +0200, Sascha Hauer wrote:
> On Thu, Apr 08, 2010 at 10:53:25AM +0100, Mark Brown wrote:
> > On Thu, Apr 08, 2010 at 11:31:26AM +0200, Sascha Hauer wrote:
> >
> > > - /* Restart the timer; if we didn't report we'll run on the next tick */
> > > - add_timer(&iprtd->timer);
> > > + hrtimer_forward_now(hrt, ns_to_ktime(iprtd->poll_time_ns));
> >
> > Hrm, this looks like it's going to have an issue with clock drift -
> > we're now unconditionally advancing the timer every period, even if the
> > data transfer hasn't pushed through a period of data. This will cause
> > problems on lengthy playbacks (and shorter ones if the clocks are
> > sufficiently out of sync).
>
> We are calling snd_pcm_period_elapsed when at least one period is over.
> As I see it the worst thing that could happen is that we have not
> transfered enough data for one period in the timer callback and thus we
> call snd_pcm_period_elapsed in the next timer callback, so about one
> period too late, but the comment in sound/core/pcm_lib.c says:
>
> Even if more than one periods have elapsed since the last call, you
> have to call this only once.
>
> So I think this should be save.
Yeah agreed, as long as it's called at least once then we should be safe
here.
Btw, how does this driver behave under moderate -> heavy IO load. I do
remember the SDMA based driver occasionally starved the SSI FIFO under
moderate IO load (i.e. aplay reading wav file over NFS).
All Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
next prev parent reply other threads:[~2010-04-08 13:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-08 9:31 imx-ssi fixes Sascha Hauer
2010-04-08 9:31 ` [PATCH 1/3] imx-ssi: honor IMX_SSI_DMA flag Sascha Hauer
2010-04-08 9:31 ` [PATCH 2/3] imx-pcm-dma-mx2: restart DMA after an error Sascha Hauer
2010-04-08 9:31 ` [PATCH 3/3] imx-ssi: Use a hrtimer in FIQ mode Sascha Hauer
2010-04-08 9:53 ` Mark Brown
2010-04-08 13:13 ` Sascha Hauer
2010-04-08 13:30 ` Liam Girdwood [this message]
2010-04-08 15:40 ` Sascha Hauer
2010-04-08 14:03 ` Mark Brown
2010-04-08 15:14 ` Liam Girdwood
2010-04-08 15:45 ` Mark Brown
2010-04-08 15:29 ` Valentin Longchamp
2010-04-08 14:47 ` imx-ssi fixes Mark Brown
2010-04-08 15:51 ` Sascha Hauer
2010-04-08 15:54 ` 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=1270733413.3248.403.camel@odin \
--to=lrg@slimlogic.co.uk \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=s.hauer@pengutronix.de \
--cc=valentin.longchamp@epfl.ch \
/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).