* [PATCH v2 0/2] soc: qcom: rpmh-rsc: Updates for RPMh read requests
@ 2026-09-11 9:08 Maulik Shah
2026-09-11 9:08 ` [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request Maulik Shah
2026-09-11 9:08 ` [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms Maulik Shah
0 siblings, 2 replies; 11+ messages in thread
From: Maulik Shah @ 2026-09-11 9:08 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa, Dmitry Baryshkov,
Mark Brown
Cc: linux-arm-msm, linux-kernel, Konrad Dybcio, Maulik Shah,
Mukesh Ojha
This series carries two RPMh read request updates.
RSC v4.5 and newer expect read commands to use a 4-byte message payload,
while write commands continue to use 8 bytes. Update the message length
used for read requests on those controllers.
Some platforms either do not support RPMh read requests or AOSS does not
respond to them. Issuing a read there can occupy an ACTIVE TCS indefinitely
and block subsequent write requests. Skip read commands on sm8150 and
sc8180x [1] returning a zero resource level so callers avoid error handling
for an unsupported read path.
Patch 1 has no dependency. A Fixes tag is not required because existing
upstream SoCs use RSC versions older than v4.5. Patch 1 can be applied as
preparation for Hawi SoC support.
Patch 2 carries a Fixes tag. I do not have sm8150 or sc8180x hardware to
verify patch 2. If there are reports like [1] of read requests not working
on past SoCs, the list can be expanded in rpmh_rsc_no_rpmh_read().
[1] https://lore.kernel.org/linux-arm-msm/0a73bc50-71f4-43f8-9d95-14a763d63c61@oss.qualcomm.com/
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
Changes in v2:
- Define CMD_MSGID_LEN as a field and use FIELD_PREP() for lengths.
- Keep the read length selection explicit for RSC v4.5 and newer.
- Keep Tested-by for patch-1.
- No changes to patch-2.
- Link to v1: https://patch.msgid.link/20260910-rsc_read-v1-0-c9b7fa3cdde2@oss.qualcomm.com
To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Maulik Shah <maulik.shah@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: Mark Brown <broonie@kernel.org>
To: Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Maulik Shah (2):
soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request
soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
drivers/soc/qcom/rpmh-internal.h | 2 ++
drivers/soc/qcom/rpmh-rsc.c | 21 ++++++++++++++++++---
drivers/soc/qcom/rpmh.c | 6 ++++++
3 files changed, 26 insertions(+), 3 deletions(-)
---
base-commit: c68a982815dcce5464e3bf2a31ac94f5146c04ca
change-id: 20260910-rsc_read-27d689e37cb5
Best regards,
--
Maulik Shah <maulik.shah@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request
2026-09-11 9:08 [PATCH v2 0/2] soc: qcom: rpmh-rsc: Updates for RPMh read requests Maulik Shah
@ 2026-09-11 9:08 ` Maulik Shah
2026-10-05 7:00 ` Mukesh Ojha
2026-09-11 9:08 ` [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms Maulik Shah
1 sibling, 1 reply; 11+ messages in thread
From: Maulik Shah @ 2026-09-11 9:08 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa, Dmitry Baryshkov,
Mark Brown
Cc: linux-arm-msm, linux-kernel, Konrad Dybcio, Maulik Shah,
Mukesh Ojha
Newer SoC like hawi with RSC version v4.5 support 4 byte message read
request instead of default 8 byte on older SoCs. The write request
continues to be 8 bytes.
The CMD_MSGID_LEN field is [3:0] bits. Describe the length bits as a
GENMASK() and use FIELD_PREP() when programming 4-byte or 8-byte message
length.
Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> #Hawi
Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
---
drivers/soc/qcom/rpmh-rsc.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
index c4542318eac4..c5ed9874bb67 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -7,6 +7,7 @@
#define pr_fmt(fmt) "%s " fmt, KBUILD_MODNAME
#include <linux/atomic.h>
+#include <linux/bitfield.h>
#include <linux/cpu_pm.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
@@ -86,7 +87,7 @@ enum {
#define TCS_AMC_MODE_TRIGGER BIT(24)
/* TCS CMD register bit mask */
-#define CMD_MSGID_LEN 8
+#define CMD_MSGID_LEN GENMASK(3, 0)
#define CMD_MSGID_RESP_REQ BIT(8)
#define CMD_MSGID_WRITE BIT(16)
#define CMD_STATUS_ISSUED BIT(8)
@@ -499,13 +500,20 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id,
const struct tcs_request *msg)
{
u32 msgid;
- u32 cmd_msgid = CMD_MSGID_LEN;
+ u32 cmd_msgid;
u32 cmd_enable = 0;
struct tcs_cmd *cmd;
int i, j;
/* Convert all commands to RR when the request has wait_for_compl set */
- cmd_msgid |= msg->wait_for_compl ? CMD_MSGID_RESP_REQ : 0;
+ cmd_msgid = msg->wait_for_compl ? CMD_MSGID_RESP_REQ : 0;
+
+ if (msg->is_read && (drv->ver.major > 4 ||
+ (drv->ver.major == 4 && drv->ver.minor >= 5)))
+ cmd_msgid |= FIELD_PREP(CMD_MSGID_LEN, 4);
+ else
+ cmd_msgid |= FIELD_PREP(CMD_MSGID_LEN, 8);
+
if (!msg->is_read)
cmd_msgid |= CMD_MSGID_WRITE;
--
2.43.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
2026-09-11 9:08 [PATCH v2 0/2] soc: qcom: rpmh-rsc: Updates for RPMh read requests Maulik Shah
2026-09-11 9:08 ` [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request Maulik Shah
@ 2026-09-11 9:08 ` Maulik Shah
2026-09-21 14:29 ` Konrad Dybcio
2026-11-30 2:43 ` Jarod Anders
1 sibling, 2 replies; 11+ messages in thread
From: Maulik Shah @ 2026-09-11 9:08 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa, Dmitry Baryshkov,
Mark Brown
Cc: linux-arm-msm, linux-kernel, Konrad Dybcio, Maulik Shah
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 c5ed9874bb67..054122ccc46c 100644
--- a/drivers/soc/qcom/rpmh-rsc.c
+++ b/drivers/soc/qcom/rpmh-rsc.c
@@ -987,6 +987,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 {
@@ -1156,6 +1162,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
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
2026-09-11 9:08 ` [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms Maulik Shah
@ 2026-09-21 14:29 ` Konrad Dybcio
2026-10-13 19:35 ` Dmitry Baryshkov
2026-11-30 2:43 ` Jarod Anders
1 sibling, 1 reply; 11+ messages in thread
From: Konrad Dybcio @ 2026-09-21 14:29 UTC (permalink / raw)
To: Maulik Shah, Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa,
Dmitry Baryshkov, Mark Brown
Cc: linux-arm-msm, linux-kernel
On 9/11/26 11:08 AM, Maulik Shah wrote:
> 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>
> ---
This works as an immediate fix, but I'd like to get some
comment on this:
https://lore.kernel.org/all/3058d570-aeb9-4f73-831c-c30626296006@oss.qualcomm.com/
[...]
> 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;
> + }
This should be -EOPNOTSUPP and consumers should handle it
appropriately
Konrad
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request
2026-09-11 9:08 ` [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request Maulik Shah
@ 2026-10-05 7:00 ` Mukesh Ojha
2026-10-05 7:10 ` Dmitry Baryshkov
0 siblings, 1 reply; 11+ messages in thread
From: Mukesh Ojha @ 2026-10-05 7:00 UTC (permalink / raw)
To: Maulik Shah
Cc: Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa, Dmitry Baryshkov,
Mark Brown, linux-arm-msm, linux-kernel, Konrad Dybcio
On Fri, Sep 11, 2026 at 02:38:13PM +0530, Maulik Shah wrote:
> Newer SoC like hawi with RSC version v4.5 support 4 byte message read
> request instead of default 8 byte on older SoCs. The write request
> continues to be 8 bytes.
>
> The CMD_MSGID_LEN field is [3:0] bits. Describe the length bits as a
> GENMASK() and use FIELD_PREP() when programming 4-byte or 8-byte message
> length.
>
> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> #Hawi
> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
I know LPC is going to start today, but I wanted to highlight this patch
specifically, as without it, both Hawi and Maili SoC do not boot up at all.
Can this be picked up as an independent patch for 7.4 as conveyed in the
cover letter?
--
-Mukesh Ojha
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request
2026-10-05 7:00 ` Mukesh Ojha
@ 2026-10-05 7:10 ` Dmitry Baryshkov
2026-10-07 9:52 ` Maulik Shah
0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-10-05 7:10 UTC (permalink / raw)
To: Mukesh Ojha
Cc: Maulik Shah, Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa,
Mark Brown, linux-arm-msm, linux-kernel, Konrad Dybcio
On Mon, Oct 05, 2026 at 12:30:21PM +0530, Mukesh Ojha wrote:
> On Fri, Sep 11, 2026 at 02:38:13PM +0530, Maulik Shah wrote:
> > Newer SoC like hawi with RSC version v4.5 support 4 byte message read
> > request instead of default 8 byte on older SoCs. The write request
> > continues to be 8 bytes.
> >
> > The CMD_MSGID_LEN field is [3:0] bits. Describe the length bits as a
> > GENMASK() and use FIELD_PREP() when programming 4-byte or 8-byte message
> > length.
> >
> > Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> #Hawi
> > Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
>
> I know LPC is going to start today, but I wanted to highlight this patch
> specifically, as without it, both Hawi and Maili SoC do not boot up at all.
>
> Can this be picked up as an independent patch for 7.4 as conveyed in the
> cover letter?
You've sent two patches in the same series. Typically maintainers prefer
to pick all or nothing. Also, Fixes should come before the actual
changes.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request
2026-10-05 7:10 ` Dmitry Baryshkov
@ 2026-10-07 9:52 ` Maulik Shah
0 siblings, 0 replies; 11+ messages in thread
From: Maulik Shah @ 2026-10-07 9:52 UTC (permalink / raw)
To: Dmitry Baryshkov, Mukesh Ojha
Cc: Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa, Mark Brown,
linux-arm-msm, linux-kernel, Konrad Dybcio
On 05-10-2026 12:40, Dmitry Baryshkov wrote:
> On Mon, Oct 05, 2026 at 12:30:21PM +0530, Mukesh Ojha wrote:
>> On Fri, Sep 11, 2026 at 02:38:13PM +0530, Maulik Shah wrote:
>>> Newer SoC like hawi with RSC version v4.5 support 4 byte message read
>>> request instead of default 8 byte on older SoCs. The write request
>>> continues to be 8 bytes.
>>>
>>> The CMD_MSGID_LEN field is [3:0] bits. Describe the length bits as a
>>> GENMASK() and use FIELD_PREP() when programming 4-byte or 8-byte message
>>> length.
>>>
>>> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> #Hawi
>>> Signed-off-by: Maulik Shah <maulik.shah@oss.qualcomm.com>
>> I know LPC is going to start today, but I wanted to highlight this patch
>> specifically, as without it, both Hawi and Maili SoC do not boot up at all.
>>
>> Can this be picked up as an independent patch for 7.4 as conveyed in the
>> cover letter?
> You've sent two patches in the same series. Typically maintainers prefer
> to pick all or nothing. Also, Fixes should come before the actual
> changes.
Let me drop patch-2 and send only patch-1 in v3.
patch-2 may wait for some more comments as per [1] before merging in as fixes.
[1] https://lore.kernel.org/lkml/53ea0718-285e-4e81-8f95-76e9b0c0f6af@oss.qualcomm.com/
Thanks,
Maulik
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
2026-09-21 14:29 ` Konrad Dybcio
@ 2026-10-13 19:35 ` Dmitry Baryshkov
2026-10-14 1:12 ` Dmitry Baryshkov
0 siblings, 1 reply; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-10-13 19:35 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Maulik Shah, Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa,
Mark Brown, linux-arm-msm, linux-kernel
On Mon, Sep 21, 2026 at 04:29:43PM +0200, Konrad Dybcio wrote:
> On 9/11/26 11:08 AM, Maulik Shah wrote:
> > 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>
> > ---
>
> This works as an immediate fix, but I'd like to get some
> comment on this:
>
> https://lore.kernel.org/all/3058d570-aeb9-4f73-831c-c30626296006@oss.qualcomm.com/
Maulik, any updates? SM8150 is still broken. Should we just revert the
commit?
> [...]
>
> > 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;
> > + }
>
> This should be -EOPNOTSUPP and consumers should handle it
> appropriately
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
2026-10-13 19:35 ` Dmitry Baryshkov
@ 2026-10-14 1:12 ` Dmitry Baryshkov
0 siblings, 0 replies; 11+ messages in thread
From: Dmitry Baryshkov @ 2026-10-14 1:12 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Maulik Shah, Bjorn Andersson, Konrad Dybcio, Kamal Wadhwa,
Mark Brown, linux-arm-msm, linux-kernel
On Tue, Oct 13, 2026 at 10:35:06PM +0300, Dmitry Baryshkov wrote:
> On Mon, Sep 21, 2026 at 04:29:43PM +0200, Konrad Dybcio wrote:
> > On 9/11/26 11:08 AM, Maulik Shah wrote:
> > > 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>
> > > ---
> >
> > This works as an immediate fix, but I'd like to get some
> > comment on this:
> >
> > https://lore.kernel.org/all/3058d570-aeb9-4f73-831c-c30626296006@oss.qualcomm.com/
>
> Maulik, any updates? SM8150 is still broken. Should we just revert the
> commit?
After some debugging, on SM8150 reading XOB regulators times out (at
least it applies to ldoc1). I assume that SC8180X has some kind of a
firmware fix. As far as I can see, reading SMPS or BOB regulators always
produces 0. Reading LDOs seems to work (except for the XOBs on SM8150).
I think I have a workaround.
>
> > [...]
> >
> > > 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;
> > > + }
> >
> > This should be -EOPNOTSUPP and consumers should handle it
> > appropriately
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
@ 2026-11-09 19:43 Yun Wang
0 siblings, 0 replies; 11+ messages in thread
From: Yun Wang @ 2026-11-09 19:43 UTC (permalink / raw)
To: Maulik Shah
Cc: Bjorn Andersson, Konrad Dybcio, Konrad Dybcio, Dmitry Baryshkov,
Mark Brown, Kamal Wadhwa, linux-arm-msm, linux-kernel
Hi Maulik,
You wrote that you do not have SM8150 hardware to verify this patch, so
here is a result from an SM8150 phone, plus some measurements that may
help with deciding what to skip.
Setup: OnePlus 7 (GM1900, SM8150), OxygenOS 11 firmware, v7.4-rc1 plus
a device tree for the phone that is not upstream yet (it describes ldo1
and ldo8 of PM8150L, like sm8150-mtp and sm8150-hdk do). No other
regulator or RPMh changes. Only this patch was applied (v2 2/2; it
applies to v7.4-rc1 with an offset of 8 lines in rpmh-rsc.c; patch 1/2
was not applied). The kernel was booted with fastboot boot.
Without it the phone never gets to user space. On debug builds of the
same tree (more logging, a watchdog and, in some builds, a short
timeout for RPMh requests) the log shows this: when regulators-1
registers, the read of the VOLTAGE register of ldo1 times out ("failed
to read VOLTAGE ret = -110"), and so does a write to xo.lvl (enabling
the XO for geni_i2c) that another probe issues at about the same time,
and everything that depends on RPMh (UFS, display, USB) never probes.
The log looks like the one Dmitry posted from the HDK. With this patch
the phone booted 5 times out of 5; see "Test scope" below.
What I measured on this phone, with a debug interface that issues
single RPMh reads and writes from user space:
- Reading offset +0 (VOLTAGE) of ldoc1, ldoc8, lnbclka1, rfclka1,
vreg.sp and gpioa8 times out. Reading +4 (ENABLE) of the same
resources completes. After a timed out VOLTAGE read of ldoc1, a
write to xo.lvl times out too (with a debug kernel that gives up on
a request after 1.5 s), and only a reboot recovers.
- Reads of ordinary VRM resources (ldoa1, ldoc2, smpa4) complete in
about 40 us, but VOLTAGE and ENABLE read back as 0 (MODE of ldoa1
and ldoc2 reads back 0x80000007). That matches Dmitry's observation
that SMPS and BOB reads give 0.
- In the command DB of this phone all 64 resources of the VRM section
have aux data: 50 have 1, 11 have 2 (gpioa8, ldoc1, ldoc8,
lnbclka1-3, rfclka1-3, vreg.sp, vrm.xob) and 3 have 0 (divclka1,
divclka2, divclkc1). The six aux=2 resources I tried are the ones
whose VOLTAGE read hangs; none of the three aux=1 resources I tried
does. I could not find the encoding documented, so this is only what
I saw on this phone.
So on this firmware reads are not unsupported across the board: what
hangs is the VOLTAGE read of what look like XOB-type resources. The
downstream device trees of two SM8150 phones (OnePlus 7, Xiaomi Mi 9)
declare ldoc1 and ldoc8 as qcom,rpmh-xob-regulator, while the
downstream OnePlus 8 (SM8250) tree declares the same names as VRMs;
I could not check the SM8250 firmware. Skipping all reads on sm8150, as
this patch does, is enough to boot.
For what it is worth, the same device tree also boots with the v7.2
version of qcom-rpmh-regulator.c, which has no readback (5 boots out of
5), and with a small patch that switches a resource to the XOB ops when
its aux data is 2 (about 20 boots, no failures). If a per-resource
check like that is of interest, I can post it separately.
Test scope, so that the tag below is not read as more than it is.
Tested:
- One OnePlus 7 (GM1900, SM8150), OxygenOS 11 firmware. Kernel
7.4.0-rc1 as described above, command line with clk_ignore_unused
and pd_ignore_unused, Mobile NixOS user space (systemd). The kernel
image is loaded into RAM with fastboot boot, not flashed.
- 5 boots in a row, 5 of 5 reached user space: adb answered 11-12 s
after fastboot boot, and each boot was checked at about 45 s of
uptime.
- The same on all 5 boots: systemd "running" with no failed units;
/sys/kernel/debug/devices_deferred empty; no WARNING, call trace or
BUG in dmesg; no dmesg line with rpmh, regulator or rsc that also
says err, fail, time out or warn; ldo1 and ldo8 of PM8150L listed in
regulator_summary at 1800 mV, as with the v7.2 driver.
- Up in dmesg: UFS (the root file system is on it), DPU/DSI with fb0
and the console, USB (adb), the Synaptics S3706B touch controller on
geni i2c, pm8941_pwrkey and gpio-keys as input devices. cpufreq: all
three policies reached their maximum under an 8 s all-core load.
Not tested:
- Anything beyond booting: no suspend, no long uptime (about a minute
per boot), and no GPU, audio, modem, Wi-Fi, Bluetooth or camera
(not enabled in my device tree). I did not look at the screen or
press keys in these 5 runs.
- arm-smmu 2ca0000.iommu (the GPU's) fails to probe with -110 on all
of them. It does the same with the v7.2 driver and with my own
regulator patch, so this patch does not cause it; I have not looked
into why.
- What the zeros do: with reads skipped, the regulator driver sees
VOLTAGE, ENABLE and MODE as 0 when it registers a regulator. Nothing
looked wrong, but I did not check any consumer that could depend on
the real values.
- Other hardware or firmware: one unit only, not SC8180X or SM7150,
and patch 1/2 was not applied.
- A series of the exact same image without this patch: the failing
boots described above are from debug builds of the same tree.
Tested-by: Yun Wang <7z0423arsenova@proton.me> # OnePlus 7 (SM8150), v2 2/2 only, on v7.4-rc1
Thanks,
Yun Wang
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms
2026-09-11 9:08 ` [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms Maulik Shah
2026-09-21 14:29 ` Konrad Dybcio
@ 2026-11-30 2:43 ` Jarod Anders
1 sibling, 0 replies; 11+ messages in thread
From: Jarod Anders @ 2026-11-30 2:43 UTC (permalink / raw)
To: Maulik Shah
Cc: Bjorn Andersson, Konrad Dybcio, Konrad Dybcio, Kamal Wadhwa,
Dmitry Baryshkov, Mark Brown, linux-arm-msm, linux-kernel,
Jarod Anders
On Fri, Sep 11, 2026 at 02:38:14PM +0530, Maulik Shah wrote:
> 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.
Another SM8150 data point: the Microsoft Surface Duo (1st gen) hangs the
same way on v7.3.6. The display never comes up, and the log (recovered
through ramoops) ends with:
qcom-rpmh-regulator 18200000.rsc:regulators-1: failed to read VOLTAGE ret = -110
ldo1: Setting 1800000-1800000uV
WARNING: drivers/soc/qcom/rpmh.c:425 at rpmh_write_batch+0x17c/0x298
Error sending AMC RPMH requests (-110)
That's the PM8150L (pmic-id "c") regulators, then ldo1, which fits
Dmitry's finding that the ldoc1 read is the one that times out.
With this patch applied on top of v7.3.6, the Duo boots normally again.
Both DSI panels, GPU, DSPs, Wi-Fi, Bluetooth, audio and sensors work as
they did on v6.19, and no RPMh timeouts are logged. (The kernel also
carries out-of-tree board patches for the Duo, none of which touch RPMh.)
Tested-by: Jarod Anders <janders7762@gmail.com> # Microsoft Surface Duo (SM8150)
Thanks,
Jarod Anders
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-11-30 2:44 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 9:08 [PATCH v2 0/2] soc: qcom: rpmh-rsc: Updates for RPMh read requests Maulik Shah
2026-09-11 9:08 ` [PATCH v2 1/2] soc: qcom: rpmh-rsc: Update CMD_MSGID_LEN to 4 bytes for read request Maulik Shah
2026-10-05 7:00 ` Mukesh Ojha
2026-10-05 7:10 ` Dmitry Baryshkov
2026-10-07 9:52 ` Maulik Shah
2026-09-11 9:08 ` [PATCH v2 2/2] soc: qcom: rpmh-rsc: Skip read requests on unsupported platforms Maulik Shah
2026-09-21 14:29 ` Konrad Dybcio
2026-10-13 19:35 ` Dmitry Baryshkov
2026-10-14 1:12 ` Dmitry Baryshkov
2026-11-30 2:43 ` Jarod Anders
-- strict thread matches above, loose matches on Subject: below --
2026-11-09 19:43 Yun Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox