mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Shawn Guo <shengchao.guo@oss.qualcomm.com>,
	Srinivas Kandagatla <srini@kernel.org>,
	Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
	Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] ASoC: qcom: q6apm: Fix shared memory unmap
Date: Tue, 20 Oct 2026 07:26:43 +0100	[thread overview]
Message-ID: <56af7a4c-2212-4397-bb96-d5ba524ae9da@oss.qualcomm.com> (raw)
In-Reply-To: <20261016141153.1346219-1-shengchao.guo@oss.qualcomm.com>

On 10/16/26 3:11 PM, Shawn Guo wrote:
> Since the early buffer mapping, q6apm maps a front-end's DSP buffers
> once in pcm_new() and unmaps them in pcm_free(). The unmap side has a
> few problems, which show up when the sound card is unbound and bound
> again, e.g. by unbinding and binding any codec on the card:
> 
> - The card core removes the components before it frees the PCMs, so
>   the topology and its graph info are gone by the time pcm_free()
>   tries to unmap. The unmap is silently skipped, the DSP keeps the old
>   mapping, and the next bind fails to create the PCM:
> 
>     qcom-apm gprsvc:service:2:1: Error (1) Processing 0x0100100c cmd
>     snd-sc8280xp sound: ASoC: can't create pcm MultiMedia1 Playback :-22
> 
> - Once unmap is actually sent, every command stalls for five seconds,
>   because the response handler matches on the wrong opcode:
> 
>     qcom-apm gprsvc:service:2:1: CMD timeout for [100100d] opcode
> 
> - Unmapping the position buffer clears the circular buffer's handle
>   instead of its own.
> 
> Patch 1 fixes the unmap response handling, patch 2 makes the position
> buffer unmap clear its own handle, and patch 3 moves the unmap to the
> APM component's remove callback, before the topology is unloaded.
> Patches 1 and 2 go first so that patch 3 does not introduce the five
> second stalls.
> 
> Tested on Qualcomm Ride board by unbinding and binding the PCM1681
> codec.
> 
>   echo 0-004c > /sys/bus/i2c/drivers/pcm1681/unbind
>   echo 0-004c > /sys/bus/i2c/drivers/pcm1681/bind

Thanks for trying this case and fixing some of the issues.

Can you pl add Stable tag for these.

Other than than they look good to me.

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

--srini
> 
> Shawn Guo (3):
>   ASoC: qcom: q6apm: Fix unmap regions response handling
>   ASoC: qcom: q6apm: Clear the right handle on pos buffer unmap
>   ASoC: qcom: q6apm: Unmap DSP buffers before removing the topology
> 
>  sound/soc/qcom/qdsp6/q6apm.c | 49 ++++++++++++++++++++++++++----------
>  1 file changed, 36 insertions(+), 13 deletions(-)
> 


      parent reply	other threads:[~2026-10-20  6:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-16 14:11 Shawn Guo
2026-10-16 14:11 ` [PATCH 1/3] ASoC: qcom: q6apm: Fix unmap regions response handling Shawn Guo
2026-10-16 14:11 ` [PATCH 2/3] ASoC: qcom: q6apm: Clear the right handle on pos buffer unmap Shawn Guo
2026-10-16 14:11 ` [PATCH 3/3] ASoC: qcom: q6apm: Unmap DSP buffers before removing the topology Shawn Guo
2026-10-20  6:26 ` Srinivas Kandagatla [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56af7a4c-2212-4397-bb96-d5ba524ae9da@oss.qualcomm.com \
    --to=srinivas.kandagatla@oss.qualcomm.com \
    --cc=ajay.nandam@oss.qualcomm.com \
    --cc=broonie@kernel.org \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=shengchao.guo@oss.qualcomm.com \
    --cc=srini@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®