summaryrefslogtreecommitdiff
path: root/sound/soc/fsl/fsl_easrc.c
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2019-07-10 10:55:38 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2019-11-25 15:48:46 +0800
commitb4d37eb87a4a3aa7292ba1ac593a6701b47541cb (patch)
tree436db3170a7dc87114edf743f5c7c8794661ff8f /sound/soc/fsl/fsl_easrc.c
parent1b89c277d102331afe22aefb1379f16d4ada4474 (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/soc/fsl/fsl_easrc.c')
-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 21262ee7ded7..cea61f774bc7 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;