]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2cf1c70edfd97f25c41180d496b898f32e4b53aa
tree8c422f3e44a74b3f896f903bec5c4c1b650d8b30
parent4f418f595e751be12cef9efb274fa609badb21e2
ASoC: Intel: Sample Baytrail DSP DMA pointer only after each period

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>
sound/soc/intel/sst-baytrail-pcm.c