From: Maulik Shah <maulik.shah@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>,
Mark Brown <broonie@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Maulik Shah <maulik.shah@oss.qualcomm.com>
Subject: [PATCH 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
Date: Thu, 10 Sep 2026 14:23:02 +0530 [thread overview]
Message-ID: <20260910-rsc_read-v1-2-c9b7fa3cdde2@oss.qualcomm.com> (raw)
In-Reply-To: <20260910-rsc_read-v1-0-c9b7fa3cdde2@oss.qualcomm.com>
On some platforms AOSS do not respond to read requests. Read request in
such cases will consume the ACTIVE TCS but forever waits for a response
blocking the subsequent write requests.
Skip issuing read commands on sm8150 and sc8180x platforms. For such
platforms return success to the caller with the resource level at zero
to avoid the caller taking any action on error code.
Fixes: edbafe65eef2 ("soc: qcom: rpmh: Add support to read back resource settings")
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
drivers/soc/qcom/rpmh-internal.h | 2 ++
drivers/soc/qcom/rpmh-rsc.c | 7 +++++++
drivers/soc/qcom/rpmh.c | 6 ++++++
3 files changed, 15 insertions(+)
diff --git a/drivers/soc/qcom/rpmh-internal.h b/drivers/soc/qcom/rpmh-internal.h
index 39441a25af9b..960a62f0e931 100644
--- a/drivers/soc/qcom/rpmh-internal.h
+++ b/drivers/soc/qcom/rpmh-internal.h
@@ -75,12 +75,14 @@ struct rpmh_request {
* @cache: the list of cached requests
* @cache_lock: synchronize access to the cache data
* @dirty: was the cache updated since flush
+ * @no_rpmh_read: controller does not support or respond to read commands
* @batch_cache: Cache sleep and wake requests sent as batch
*/
struct rpmh_ctrlr {
struct list_head cache;
spinlock_t cache_lock;
bool dirty;
+ bool no_rpmh_read;
struct list_head batch_cache;
};
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index f84a399fa5dc..7a210f924af8 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -986,6 +986,12 @@ static void rpmh_rsc_cpu_pm_unregister(void *data)
cpu_pm_unregister_notifier(data);
}
+static bool rpmh_rsc_no_rpmh_read(void)
+{
+ return of_machine_is_compatible("qcom,sm8150") ||
+ of_machine_is_compatible("qcom,sc8180x");
+}
+
static int rpmh_probe_tcs_config(struct platform_device *pdev, struct rsc_drv *drv)
{
struct tcs_type_config {
@@ -1155,6 +1161,7 @@ static int rpmh_rsc_probe(struct platform_device *pdev)
spin_lock_init(&drv->client.cache_lock);
INIT_LIST_HEAD(&drv->client.cache);
INIT_LIST_HEAD(&drv->client.batch_cache);
+ drv->client.no_rpmh_read = rpmh_rsc_no_rpmh_read();
dev_set_drvdata(&pdev->dev, drv);
drv->dev = &pdev->dev;
diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
index 360242a315e3..fed2ea06f490 100644
--- a/drivers/soc/qcom/rpmh.c
+++ b/drivers/soc/qcom/rpmh.c
@@ -240,12 +240,18 @@ int rpmh_read(const struct device *dev, struct tcs_cmd *cmd)
{
DECLARE_COMPLETION_ONSTACK(compl);
DEFINE_RPMH_MSG_ONSTACK(dev, RPMH_ACTIVE_ONLY_STATE, &compl, rpm_msg);
+ struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev);
int ret;
ret = __fill_rpmh_msg(&rpm_msg, RPMH_ACTIVE_ONLY_STATE, cmd, 1, true);
if (ret)
return ret;
+ if (ctrlr->no_rpmh_read) {
+ cmd[0].data = 0;
+ return 0;
+ }
+
ret = __rpmh_write(dev, RPMH_ACTIVE_ONLY_STATE, &rpm_msg);
if (ret)
return ret;
--
2.43.0
next prev parent reply other threads:[~2026-09-10 8:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 8:53 [PATCH 0/2] soc: qcom: rpmh-rsc: Updates for RPMh read requests Maulik Shah
2026-09-10 8:53 ` [PATCH 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request Maulik Shah
2026-09-10 9:01 ` Konrad Dybcio
2026-09-11 4:53 ` Maulik Shah
2026-09-10 11:59 ` Mukesh Ojha
2026-09-10 13:51 ` Bjorn Andersson
2026-09-11 8:14 ` Maulik Shah
2026-09-10 8:53 ` Maulik Shah [this message]
2026-09-10 9:14 ` [PATCH 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms Konrad Dybcio
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=20260910-rsc_read-v1-2-c9b7fa3cdde2@oss.qualcomm.com \
--to=maulik.shah@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=broonie@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=kamal.wadhwa@oss.qualcomm.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®