ASoC: Intel: use lock when changing SST state.
authorMythri P K <mythri.p.k@intel.com>
Fri, 31 Oct 2014 07:08:21 +0000 (12:38 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 31 Oct 2014 12:47:44 +0000 (12:47 +0000)
SST state change should be done under sst_lock

Signed-off-by: Mythri P K <mythri.p.k@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/sst/sst.c
sound/soc/intel/sst/sst_ipc.c

index 7b8a110b213d02789d008394ffd83f9eb8846888..04af2460f9cce7824ff43e6887267bbaea35c1c5 100644 (file)
@@ -463,15 +463,13 @@ static int intel_sst_runtime_resume(struct device *dev)
        int ret = 0;
        struct intel_sst_drv *ctx = dev_get_drvdata(dev);
 
-       mutex_lock(&ctx->sst_lock);
        if (ctx->sst_state == SST_RESET) {
                ret = sst_load_fw(ctx);
                if (ret) {
                        dev_err(dev, "FW download fail %d\n", ret);
-                       ctx->sst_state = SST_RESET;
+                       sst_set_fw_state_locked(ctx, SST_RESET);
                }
        }
-       mutex_unlock(&ctx->sst_lock);
        return ret;
 }
 
index 2126f5bb2813e57730efb60a002bac835c62a44b..484e60978477bda7564077a2ebbe238f7558aff3 100644 (file)
@@ -230,7 +230,7 @@ static void process_fw_init(struct intel_sst_drv *sst_drv_ctx,
 
        dev_dbg(sst_drv_ctx->dev, "*** FW Init msg came***\n");
        if (init->result) {
-               sst_drv_ctx->sst_state =  SST_RESET;
+               sst_set_fw_state_locked(sst_drv_ctx, SST_RESET);
                dev_err(sst_drv_ctx->dev, "FW Init failed, Error %x\n",
                                init->result);
                retval = init->result;