From: Mythri P K Date: Fri, 31 Oct 2014 07:08:21 +0000 (+0530) Subject: ASoC: Intel: use lock when changing SST state. X-Git-Tag: v3.19-rc1~119^2~20^2~16^3~31 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=45f31bfcda0c6e5f11168de10c85f3dd20337bdf;p=karo-tx-linux.git ASoC: Intel: use lock when changing SST state. SST state change should be done under sst_lock Signed-off-by: Mythri P K Signed-off-by: Subhransu S. Prusty Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c index 7b8a110b213d..04af2460f9cc 100644 --- a/sound/soc/intel/sst/sst.c +++ b/sound/soc/intel/sst/sst.c @@ -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; } diff --git a/sound/soc/intel/sst/sst_ipc.c b/sound/soc/intel/sst/sst_ipc.c index 2126f5bb2813..484e60978477 100644 --- a/sound/soc/intel/sst/sst_ipc.c +++ b/sound/soc/intel/sst/sst_ipc.c @@ -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;