ASoC: Intel: Sample Baytrail DSP DMA pointer only after each period
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Thu, 8 May 2014 13:07:21 +0000 (16:07 +0300)
committerMark Brown <broonie@linaro.org>
Mon, 12 May 2014 21:02:17 +0000 (22:02 +0100)
This is for preparing suspend/resume support but can give also more
safeguard against concurrent timestamp structure access between DSP firmware
and host.

Now DSP DMA pointer is sampled in each pcm pointer callback in
sst_byt_pcm_pointer() but that is unneeded since DSP updates the timestamp
period basis and can potentially be racy if sst_byt_pcm_pointer() is called
when DSP is updating the timestamp.

By taking DSP DMA pointer only after period elapsed IPC messages in
byt_notify_pointer() and returning stored hw pointer in
sst_byt_pcm_pointer() there is less risk for concurrent access.

The same stored hw pointer can be also used in suspend/resume code for
restarting the stream at the same position.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

No differences found