summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisael Lopez Cruz <misael.lopez@ti.com>2011-01-14 15:37:18 -0600
committerRicardo Neri <ricardo.neri@ti.com>2011-01-15 15:17:32 -0600
commitf94a9ee6d525d950d29626ce28b10671fe62f3ca (patch)
treed707744c5d0e7dbe10d0d0e9bdfc1c9876355673
parent311adfbfee015cb1efe512c0128c9c23ed89c81e (diff)
ASoC: McPDM: Fix full duplex race conditions
During full-duplex scenario, it's possible for capture stream to free mcpdm interface if capture shutdown() call occurs between playback startup() and hw_params(). To prevent this race condition capture stream should check dl_active counter, which is incremented in playback startup(). Change-Id: I9cae1a48a818f022501122a4c5903de66aec66ac Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
-rw-r--r--sound/soc/omap/omap-mcpdm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c
index a1f48f1cc887..57824b676d55 100644
--- a/sound/soc/omap/omap-mcpdm.c
+++ b/sound/soc/omap/omap-mcpdm.c
@@ -659,7 +659,8 @@ static void omap_mcpdm_abe_dai_shutdown(struct snd_pcm_substream *substream,
if (!dai->active) {
if (!mcpdm->ul_active && substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
omap_mcpdm_capture_close(mcpdm, mcpdm->uplink);
- if (!mcpdm->free && !mcpdm->dn_channels)
+ if (!mcpdm->free && !mcpdm->dn_channels &&
+ !mcpdm->dl_active)
omap_mcpdm_free(mcpdm);
}
if (!mcpdm->dl_active && substream->stream == SNDRV_PCM_STREAM_PLAYBACK)