Skip to content

ASoC: qcom: qdsp6: handle SMD FIFO -EAGAIN in q6asm playback

Vladimir Bely linux-arm-msm linux-sound lkml stable 3 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 1 replyIn review
  2. v22 patches 0 repliesSuperseded
  3. v12 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Patch 1: fix Fixes: trailer subjects and add Fixes: fdbb53d318aa.
- Patch 2:
- Defer playback queuing in q6asm_dai_ack() until snd_pcm_running(substream) and queue after q6asm_run_nowait() in q6asm_dai_trigger() (with CMD_RUN_DONE retry) so a full SMD FIFO before start cannot fail SNDRV_PCM_TRIGGER_START with -EAGAIN.
- Combine snd_pcm_period_elapsed_under_stream_lock() and q6asm_dai_queue_playback() under a single pcm_stream_lock_irqsave.
- Fix the Fixes: trailer subject.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ASoC: qcom: q6asm: don't advance dsp_buf on failed write or readsound/soc/qcom/qdsp6/q6asm.c+27 -170 replies
2/2ASoC: qcom: q6asm-dai: retry playback queuing on -EAGAINsound/soc/qcom/qdsp6/q6asm-dai.c+61 -140 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/2] ASoC: qcom: qdsp6: handle SMD FIFO -EAGAIN in q6asm playback

On SoCs with a small SMD FIFO (such as MSM8916), a playback burst in q6asm_dai_ack() can fill the FIFO so rpmsg_trysend() returns -EAGAIN. Today q6asm_write_async() still advances port->dsp_buf on that failed send, and q6asm_dai_ack() fails the write with -EAGAIN.

Patch 1 keeps port->dsp_buf unchanged when apr_send_pkt() fails and protects port->buf teardown under ac->lock. Patch 2 defers queuing until trigger start, stops cleanly on -EAGAIN, and retries on CMD_RUN_DONE and DATA_WRITE_DONE under the PCM stream lock while the stream is running.

Changes in v3 (addressing Sashiko AI review):
- Patch 1: fix Fixes: trailer subjects and add Fixes: fdbb53d318aa.
- Patch 2:
- Defer playback queuing in q6asm_dai_ack() until snd_pcm_running(substream) and queue after q6asm_run_nowait() in q6asm_dai_trigger() (with CMD_RUN_DONE retry) so a full SMD FIFO before start cannot fail SNDRV_PCM_TRIGGER_START with -EAGAIN.
- Combine snd_pcm_period_elapsed_under_stream_lock() and q6asm_dai_queue_playback() under a single pcm_stream_lock_irqsave.
- Fix the Fixes: trailer subject.

Changes in v2:
- Patch 1: clear port->buf and port->dsp_buf under ac->lock in q6asm_audio_client_free_buf() and check !port->buf || !port->num_periods in q6asm_write_async() and q6asm_read().
- Patch 2: bound avail <= runtime->buffer_size; serialize event_handler() with ack/stop/XRUN/prepare/close via pcm_stream_lock_irqsave and snd_pcm_running(substream).

Vladimir Bely (2):
ASoC: qcom: q6asm: don't advance dsp_buf on failed write or read
ASoC: qcom: q6asm-dai: retry playback queuing on -EAGAIN

 sound/soc/qcom/qdsp6/q6asm-dai.c | 75 ++++++++++++++++++++++++++------
 sound/soc/qcom/qdsp6/q6asm.c     | 44 +++++++++++--------
 2 files changed, 88 insertions(+), 31 deletions(-)

base-commit: 626d2233d48884f22c16011a6e44f905824bd8e0

Signature · 1 line
2.43.0