From 43735c25a87c504ca19deea4058891cdc5b3fedf Mon Sep 17 00:00:00 2001 From: mcc45tr Date: Sat, 5 Sep 2026 17:26:04 +0300 Subject: [PATCH] ASoC: qcom: drop unreliable rendered-EOS wait --- sound/soc/qcom/qdsp6/q6asm-dai.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 0263a43add82..4f09fdd40905 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -3,7 +3,6 @@ // Copyright (c) 2018, Linaro Limited #include -#include #include #include #include @@ -72,7 +71,6 @@ struct q6asm_dai_rtd { uint32_t stream_id; uint16_t session_id; enum stream_state state; - struct completion eos_done; uint32_t initial_samples_drop; uint32_t trailing_samples_drop; bool notify_on_drain; @@ -188,7 +186,6 @@ static void event_handler(uint32_t opcode, uint32_t token, case ASM_CLIENT_EVENT_CMD_RUN_DONE: break; case ASM_CLIENT_EVENT_CMD_EOS_DONE: - complete_all(&prtd->eos_done); break; case ASM_CLIENT_EVENT_DATA_WRITE_DONE: snd_pcm_period_elapsed(substream); @@ -228,11 +225,6 @@ static int q6asm_dai_prepare(struct snd_soc_component *component, /* rate and channels are sent to audio driver */ if (prtd->state == Q6ASM_STREAM_RUNNING) { /* clear the previous setup if any */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && - !wait_for_completion_timeout(&prtd->eos_done, - msecs_to_jiffies(1000))) - dev_warn(dev, "rendered EOS timed out before stream re-prepare\n"); - ret = q6asm_cmd(prtd->audio_client, prtd->stream_id, CMD_CLOSE); if (ret < 0) { dev_err(dev, "Failed to close q6asm stream %d\n", prtd->stream_id); @@ -355,16 +347,8 @@ static int q6asm_dai_trigger(struct snd_soc_component *component, 0, 0, 0); break; case SNDRV_PCM_TRIGGER_STOP: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { - reinit_completion(&prtd->eos_done); - ret = q6asm_cmd_nowait(prtd->audio_client, - prtd->stream_id, CMD_EOS); - if (ret < 0) - complete_all(&prtd->eos_done); - } else { - ret = q6asm_cmd_nowait(prtd->audio_client, - prtd->stream_id, CMD_PAUSE); - } + ret = q6asm_cmd_nowait(prtd->audio_client, prtd->stream_id, + CMD_EOS); break; case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: @@ -404,8 +388,6 @@ static int q6asm_dai_open(struct snd_soc_component *component, return -ENOMEM; prtd->substream = substream; - init_completion(&prtd->eos_done); - complete_all(&prtd->eos_done); prtd->audio_client = q6asm_audio_client_alloc(dev, (q6asm_cb)event_handler, prtd, stream_id, LEGACY_PCM_MODE); @@ -480,14 +462,7 @@ static int q6asm_dai_close(struct snd_soc_component *component, struct q6asm_dai_rtd *prtd = runtime->private_data; if (prtd->audio_client) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && - prtd->state == Q6ASM_STREAM_RUNNING && - !wait_for_completion_timeout(&prtd->eos_done, - msecs_to_jiffies(1000))) - dev_warn(component->dev, - "rendered EOS timed out before stream close\n"); - - if (prtd->state != Q6ASM_STREAM_IDLE) { + if (prtd->state == Q6ASM_STREAM_RUNNING) { q6asm_cmd(prtd->audio_client, prtd->stream_id, CMD_CLOSE); q6asm_unmap_memory_regions(substream->stream, -- 2.55.0