summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2019-07-10 10:55:38 +0800
committerShengjiu Wang <shengjiu.wang@nxp.com>2019-07-10 16:38:13 +0800
commitdf564b2142acd8475c47f7c32d4ed074bccef8dd (patch)
tree530dca843819cebbf22c50c8e6539bcef6854b97 /sound
parent674c85539d26acf9d10085de798e4d0081829809 (diff)
MLK-22243: fsl_easrc: Add lock to protect configuration of slot
With multi-instance case, the fsl_easrc_config_slot will be called in parallel, the fsl_easrc_slot is independent with context, so we need to lock to protect the access of fsl_easrc_config_slot, otherwise, the slot configuration will be fail for some instance that cause "input DMA task timeout". Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_easrc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c
index f7559e9377f4..02947c271435 100644
--- a/sound/soc/fsl/fsl_easrc.c
+++ b/sound/soc/fsl/fsl_easrc.c
@@ -1065,6 +1065,7 @@ int fsl_easrc_config_context(struct fsl_easrc *easrc, unsigned int ctx_id)
{
struct fsl_easrc_context *ctx;
struct device *dev;
+ unsigned long lock_flags;
int ret;
/* to modify prefilter coeficients, the user must perform
@@ -1094,7 +1095,9 @@ int fsl_easrc_config_context(struct fsl_easrc *easrc, unsigned int ctx_id)
if (ret)
return ret;
+ spin_lock_irqsave(&easrc->lock, lock_flags);
ret = fsl_easrc_config_slot(easrc, ctx->index);
+ spin_unlock_irqrestore(&easrc->lock, lock_flags);
if (ret)
return ret;