mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Guo <shengchao.guo@oss.qualcomm.com>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>,
	Mohit Sharma <mohit.sharma@oss.qualcomm.com>
Cc: Srinivas Kandagatla <srini@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>,
	linux-sound@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/2] soc: qcom: apr: Publish GPR callback before client probe
Date: Mon, 30 Nov 2026 16:08:55 +0800	[thread overview]
Message-ID: <aw0vFxVaZ4Y0eRYU@QCOM-aGQu4IUr3Y> (raw)
In-Reply-To: <bfd794ab-7c62-4627-9c96-44a8a3bf5d3e@oss.qualcomm.com>

On Sun, Nov 15, 2026 at 10:00:40AM +0000, Srinivas Kandagatla wrote:
> On 10/22/26 3:41 PM, Mohit Sharma wrote:
> > A GPR service driver can issue synchronous commands from its probe path,
> > or populate child devices which issue commands before the parent probe
> > returns. The APR/GPR bus currently installs the GPR service callback only
> > after the service driver's probe has completed.
> > 
> > If a response arrives while the client probe is still running, GPR finds
> > the destination service but cannot dispatch the response because the
> > service callback is NULL. The client waiting for the response eventually
> > times out.
> > 
> > This was observed intermittently on Qualcomm Lemans and Monaco platforms
> > when q6apm child probing sent an APM shared-memory map command before the
> > parent probe returned. The failure has the following signature:
> > 
> >   qcom-apm ... CMD timeout for [100100c] opcode
> >   q6apm-dai ... Audio Start: Buffer Allocation failed rc = -110
> >   snd-sc8280xp ... ASoC: can't create pcm MultiMedia1 Playback :-110
> > 
> > Install the GPR callback before invoking the client probe so responses to
> > probe-time commands can be dispatched. Clear the callback again if probe
> > fails, and preserve the existing callback ordering for APR clients.
> > 
> > Fixes: ec1471a898cc ("soc: qcom: apr: Add GPR support")
> > Cc: stable@vger.kernel.org
> > Co-developed-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> > Signed-off-by: Ajay Kumar Nandam <ajay.nandam@oss.qualcomm.com>
> > Signed-off-by: Mohit Sharma <mohit.sharma@oss.qualcomm.com>
> > ---
> >  drivers/soc/qcom/apr.c | 15 +++++++++++++--
> >  1 file changed, 13 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/soc/qcom/apr.c b/drivers/soc/qcom/apr.c
> > index ea7f83916d8d..829e5c8fdf98 100644
> > --- a/drivers/soc/qcom/apr.c
> > +++ b/drivers/soc/qcom/apr.c
> > @@ -365,13 +365,24 @@ static int apr_device_probe(struct device *dev)
> >  {
> >  	struct apr_device *adev = to_apr_device(dev);
> >  	struct apr_driver *adrv = to_apr_driver(dev->driver);
> > +	struct packet_router *apr = dev_get_drvdata(dev->parent);
> >  	int ret;
> >  
> > +	if (apr->type == PR_TYPE_GPR)
> > +		adev->svc.callback = adrv->gpr_callback;
> Why do we need this check?
> > +
> >  	ret = adrv->probe(adev);
> > -	if (!ret)
> > +	if (ret) {
> > +		if (apr->type == PR_TYPE_GPR)
> > +			adev->svc.callback = NULL;
> same

Hi Mohit,

Do you plan to address review comment soon? Otherwise, I will just send
my version of the similar change.

Shawn

  reply	other threads:[~2026-11-30  8:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 14:41 [PATCH 0/2] Fix GPR callback registration race during probe Mohit Sharma
2026-10-22 14:41 ` [PATCH 1/2] ASoC: qcom: q6apm: Guard callbacks until probe data is ready Mohit Sharma
2026-11-15 10:06   ` Srinivas Kandagatla
2026-10-22 14:41 ` [PATCH 2/2] soc: qcom: apr: Publish GPR callback before client probe Mohit Sharma
2026-11-14 15:25   ` Shawn Guo
2026-11-15 10:00   ` Srinivas Kandagatla
2026-11-30  8:08     ` Shawn Guo [this message]
2026-11-02 22:38 ` (subset) [PATCH 0/2] Fix GPR callback registration race during probe Mark Brown

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=aw0vFxVaZ4Y0eRYU@QCOM-aGQu4IUr3Y \
    --to=shengchao.guo@oss.qualcomm.com \
    --cc=ajay.nandam@oss.qualcomm.com \
    --cc=andersson@kernel.org \
    --cc=broonie@kernel.org \
    --cc=konradybcio@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=mohit.sharma@oss.qualcomm.com \
    --cc=perex@perex.cz \
    --cc=srini@kernel.org \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    --cc=stable@vger.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®