From c19aa430f89a4444e5c537c1d111569afb53889f Mon Sep 17 00:00:00 2001 From: Yamit Mehta Date: Tue, 4 Oct 2016 18:19:13 +0530 Subject: [PATCH] ASoC: msm: qdsp6v2: Modify wait event and cmd state check Modify wait event and cmd state condition check for positive integer as adsp returns positive error number. CRs-fixed: 1074954 Change-Id: Id2be933de4072f3953536c9a2b75f08763352673 Signed-off-by: Yamit Mehta --- sound/soc/msm/qdsp6v2/q6asm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/msm/qdsp6v2/q6asm.c b/sound/soc/msm/qdsp6v2/q6asm.c index 38c51eb32f4d..19105ffd9d4a 100644 --- a/sound/soc/msm/qdsp6v2/q6asm.c +++ b/sound/soc/msm/qdsp6v2/q6asm.c @@ -8326,7 +8326,7 @@ int q6asm_send_cal(struct audio_client *ac) q6asm_add_hdr_async(ac, &hdr, (sizeof(struct apr_hdr) + sizeof(struct asm_stream_cmd_set_pp_params_v2)), TRUE); - atomic_set(&ac->cmd_state, 1); + atomic_set(&ac->cmd_state, -1); hdr.opcode = ASM_STREAM_CMD_SET_PP_PARAMS_V2; payload_params.data_payload_addr_lsw = lower_32_bits(cal_block->cal_data.paddr); @@ -8352,13 +8352,13 @@ int q6asm_send_cal(struct audio_client *ac) goto free; } rc = wait_event_timeout(ac->cmd_wait, - (atomic_read(&ac->cmd_state) <= 0), 5 * HZ); + (atomic_read(&ac->cmd_state) >= 0), 5 * HZ); if (!rc) { pr_err("%s: timeout, audio audstrm cal send\n", __func__); rc = -ETIMEDOUT; goto free; } - if (atomic_read(&ac->cmd_state) < 0) { + if (atomic_read(&ac->cmd_state) > 0) { pr_err("%s: DSP returned error[%d] audio audstrm cal send\n", __func__, atomic_read(&ac->cmd_state)); rc = -EINVAL;