ASoC: msm: qdsp6v2: change to no-wait command for RTIC event
RTIC(runtime check) event ack command can execute asynchronously along with other ASM commands. Using common cmd_state variable to wake up the thread results synchronization issues. So use no-wait command for RTIC event ack command. Change-Id: Ie55ac6d50f83112e72de65c68340f7f7ba0923da Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
This commit is contained in:
parent
7683c6a144
commit
a135611457
1 changed files with 5 additions and 26 deletions
|
@ -7215,10 +7215,9 @@ int q6asm_send_rtic_event_ack(struct audio_client *ac,
|
|||
goto done;
|
||||
}
|
||||
|
||||
q6asm_add_hdr_async(ac, &ack.hdr,
|
||||
q6asm_stream_add_hdr_async(ac, &ack.hdr,
|
||||
sizeof(struct avs_param_rtic_event_ack) +
|
||||
params_length, TRUE);
|
||||
atomic_set(&ac->cmd_state, -1);
|
||||
params_length, TRUE, ac->stream_id);
|
||||
ack.hdr.opcode = ASM_STREAM_CMD_SET_ENCDEC_PARAM_V2;
|
||||
ack.encdec.param_id = AVS_PARAM_ID_RTIC_EVENT_ACK;
|
||||
ack.encdec.param_size = params_length;
|
||||
|
@ -7228,31 +7227,11 @@ int q6asm_send_rtic_event_ack(struct audio_client *ac,
|
|||
memcpy(asm_params + sizeof(struct avs_param_rtic_event_ack),
|
||||
param, params_length);
|
||||
rc = apr_send_pkt(ac->apr, (uint32_t *) asm_params);
|
||||
if (rc < 0) {
|
||||
if (rc < 0)
|
||||
pr_err("%s: apr pkt failed for rtic event ack\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto fail_send_param;
|
||||
}
|
||||
|
||||
rc = wait_event_timeout(ac->cmd_wait,
|
||||
(atomic_read(&ac->cmd_state) >= 0), 1 * HZ);
|
||||
if (!rc) {
|
||||
pr_err("%s: timeout for rtic event ack cmd\n", __func__);
|
||||
rc = -ETIMEDOUT;
|
||||
goto fail_send_param;
|
||||
}
|
||||
|
||||
if (atomic_read(&ac->cmd_state) > 0) {
|
||||
pr_err("%s: DSP returned error[%s] for rtic event ack cmd\n",
|
||||
__func__, adsp_err_get_err_str(
|
||||
atomic_read(&ac->cmd_state)));
|
||||
rc = adsp_err_get_lnx_err_code(
|
||||
atomic_read(&ac->cmd_state));
|
||||
goto fail_send_param;
|
||||
}
|
||||
else
|
||||
rc = 0;
|
||||
|
||||
fail_send_param:
|
||||
kfree(asm_params);
|
||||
done:
|
||||
return rc;
|
||||
|
|
Loading…
Add table
Reference in a new issue