[PATCH] ASoC: qcom: q6apm: Fix the wait for SHARED_MEM_UNMAP_REGIONS

From: redducc

Date: Mon Oct 19 2026 - 14:24:53 EST


The DSP acknowledges APM_CMD_SHARED_MEM_UNMAP_REGIONS with a
GPR_BASIC_RSP_RESULT packet. apm_callback() stores the packet opcode,
GPR_BASIC_RSP_RESULT, as the result opcode, but
audioreach_send_cmd_sync() waits for the result opcode to match the
command, APM_CMD_SHARED_MEM_UNMAP_REGIONS. The wait never completes,
so every unmap blocks for the full 5 s timeout and logs
"CMD timeout".

Store the opcode of the command being acknowledged, as the other
GPR_BASIC_RSP_RESULT cases already do.

Fixes: 8ea6e25c8536 ("ASoC: qcom: q6apm: Add support for early buffer mapping on DSP")
Assisted-by: LLM
Signed-off-by: redducc <sushmit718@xxxxxxxxx>
---
sound/soc/qcom/qdsp6/q6apm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
index b6b1ef6833b3..379b15b7e503 100644
--- a/sound/soc/qcom/qdsp6/q6apm.c
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -960,7 +960,7 @@ static int apm_callback(const struct gpr_resp_pkt *data, void *priv, int op)
wake_up(&apm->wait);
break;
case APM_CMD_SHARED_MEM_UNMAP_REGIONS:
- apm->result.opcode = hdr->opcode;
+ apm->result.opcode = result->opcode;
apm->result.status = 0;
rsp = data->payload;


base-commit: 6a56f4f29711dd2da49f03a5b99ce53779e638d7
prerequisite-patch-id: 154550924ab1d2c1bc95517c058aaee0bb242f92
prerequisite-patch-id: 22bca48e48813fb55976db043f9c35c926c61e3d
prerequisite-patch-id: cd21b1ff6a4fef14c706cea97fc906d7a0331b5c
prerequisite-patch-id: ce4057205dd2c2a6650c3a36c60664bd2737e202
--
2.43.0