From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>,
Ratna Deepthi Kudaravalli <rkudarav@qti.qualcomm.com>,
Mark Brown <broonie@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1.y 1/2] ASoC: qdsp6: audioreach: Add ADSP ready check
Date: Sat, 14 Nov 2026 01:34:12 -0500 [thread overview]
Message-ID: <20261114063359.3219746-1-sashal@kernel.org> (raw)
In-Reply-To: <20261109201639-failed-6.1-ef7062864c05@kernel.org>
From: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
[ Upstream commit 47bc8cf60e926d1fb0c5d990bf6f5e01e9b3352e ]
Check for SPF readiness in prm driver probe to avoid race conditions
during ADSP pil loading.
This patch is to avoid, sending requests to ADSP before it's
power domains are up and ready.
Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@quicinc.com>
Tested-by: Ratna Deepthi Kudaravalli <rkudarav@qti.qualcomm.com>
Link: https://lore.kernel.org/r/1673508617-27410-1-git-send-email-quic_srivasam@quicinc.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: ef7062864c05 ("ASoC: qcom: q6apm: Guard callbacks until probe data is ready")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/qcom/qdsp6/q6apm.c | 13 +++++++++++++
sound/soc/qcom/qdsp6/q6apm.h | 2 ++
sound/soc/qcom/qdsp6/q6prm.c | 4 ++++
3 files changed, 19 insertions(+)
diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c
index 48488ba2be212..4f9143b903b31 100644
--- a/sound/soc/qcom/qdsp6/q6apm.c
+++ b/sound/soc/qcom/qdsp6/q6apm.c
@@ -27,6 +27,8 @@ struct apm_graph_mgmt_cmd {
#define APM_GRAPH_MGMT_PSIZE(p, n) ALIGN(struct_size(p, sub_graph_id_list, n), 8)
+struct q6apm *g_apm;
+
int q6apm_send_cmd_sync(struct q6apm *apm, struct gpr_pkt *pkt, uint32_t rsp_opcode)
{
gpr_device_t *gdev = apm->gdev;
@@ -143,6 +145,15 @@ static void q6apm_put_audioreach_graph(struct kref *ref)
kfree(graph);
}
+bool q6apm_is_adsp_ready(void)
+{
+ if (g_apm && g_apm->state)
+ return true;
+
+ return false;
+}
+EXPORT_SYMBOL_GPL(q6apm_is_adsp_ready);
+
static int q6apm_get_apm_state(struct q6apm *apm)
{
struct gpr_pkt *pkt;
@@ -760,6 +771,8 @@ static int apm_probe(gpr_device_t *gdev)
idr_init(&apm->modules_idr);
+ g_apm = apm;
+
q6apm_get_apm_state(apm);
ret = snd_soc_register_component(dev, &q6apm_audio_component, NULL, 0);
diff --git a/sound/soc/qcom/qdsp6/q6apm.h b/sound/soc/qcom/qdsp6/q6apm.h
index 54eadadf712cb..5b51e155282fd 100644
--- a/sound/soc/qcom/qdsp6/q6apm.h
+++ b/sound/soc/qcom/qdsp6/q6apm.h
@@ -149,4 +149,6 @@ bool q6apm_is_sub_graphs_connected(struct q6apm *apm, u32 src_sgid,
u32 dst_sgid);
int q6apm_graph_get_rx_shmem_module_iid(struct q6apm_graph *graph);
+bool q6apm_is_adsp_ready(void);
+
#endif /* __APM_GRAPH_ */
diff --git a/sound/soc/qcom/qdsp6/q6prm.c b/sound/soc/qcom/qdsp6/q6prm.c
index 41a29047ff010..e3b8ddeb769eb 100644
--- a/sound/soc/qcom/qdsp6/q6prm.c
+++ b/sound/soc/qcom/qdsp6/q6prm.c
@@ -12,6 +12,7 @@
#include <linux/soc/qcom/apr.h>
#include <dt-bindings/soc/qcom,gpr.h>
#include <dt-bindings/sound/qcom,q6dsp-lpass-ports.h>
+#include "q6apm.h"
#include "q6prm.h"
#include "audioreach.h"
@@ -226,6 +227,9 @@ static int prm_probe(gpr_device_t *gdev)
init_waitqueue_head(&cc->wait);
dev_set_drvdata(dev, cc);
+ if (!q6apm_is_adsp_ready())
+ return -EPROBE_DEFER;
+
return devm_of_platform_populate(dev);
}
--
2.53.0
next prev parent reply other threads:[~2026-11-14 6:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 1:16 FAILED: patch "[PATCH] ASoC: qcom: q6apm: Guard callbacks until probe data is ready" failed to apply to 6.1-stable tree Sasha Levin
2026-11-14 6:34 ` Sasha Levin [this message]
2026-11-14 6:34 ` [PATCH 6.1.y 2/2] ASoC: qcom: q6apm: Guard callbacks until probe data is ready Sasha Levin
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=20261114063359.3219746-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=broonie@kernel.org \
--cc=quic_srivasam@quicinc.com \
--cc=rkudarav@qti.qualcomm.com \
--cc=stable@vger.kernel.org \
/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