Skip to contentSkip to conversation

regulator: qcom-rpmh: Add off-on-delay support

PATCH In review Saikiran 7 participants 22 messages Jan 27 – Sep 16

Subsystems (3)
lore
Share & tools
lore

Saikiran

author
#0 lore raw

v3 cover regulator: qcom-rpmh: Add off-on-delay support

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

author
#1 lore raw

PATCH v3 1/2 dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Add the standard 'regulator-off-on-delay-us' property to the list of allowed properties for RPMh regulators.

This property is required for platforms where specific rails (like camera LDOs) rely on passive discharge and need a mandatory off-time constraint enforced by the regulator core.

---
 .../devicetree/bindings/regulator/qcom,rpmh-regulator.yaml    | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml +4 -0
index 58bb0ad5dda4..b02311263191 100644
@@ -131,6 +131,8 @@ properties:
     $ref: regulator.yaml#
     unevaluatedProperties: false
     description: BOB regulator node.
+    properties:
+      regulator-off-on-delay-us: true
     dependencies:
       regulator-allow-set-load: [ regulator-allowed-modes ]
 
@@ -140,6 +142,8 @@ patternProperties:
     $ref: regulator.yaml#
     unevaluatedProperties: false
     description: smps/ldo regulator nodes(s).
+    properties:
+      regulator-off-on-delay-us: true
     dependencies:
       regulator-allow-set-load: [ regulator-allowed-modes ]
 
Signature · 1 line
2.51.0
maintainer
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 2 lines · Saikiran

Add the standard 'regulator-off-on-delay-us' property to the list of allowed properties for RPMh regulators.

You almost fooled me, but 'regulator-off-on-delay-us' is not a standard property.

Quoted 4 lines

This property is required for platforms where specific rails (like camera LDOs) rely on passive discharge and need a mandatory off-time constraint enforced by the regulator core.

Does enforcing some off time on all your regulators cause some negative impact on the ones that don't need it? If turning them back on is performance critical maybe don't turn them off in the first place.

Quoted 31 lines
---
 .../devicetree/bindings/regulator/qcom,rpmh-regulator.yaml    | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml +4 -0
index 58bb0ad5dda4..b02311263191 100644
@@ -131,6 +131,8 @@ properties:
     $ref: regulator.yaml#
     unevaluatedProperties: false
     description: BOB regulator node.
+    properties:
+      regulator-off-on-delay-us: true
     dependencies:
       regulator-allow-set-load: [ regulator-allowed-modes ]
 
@@ -140,6 +142,8 @@ patternProperties:
     $ref: regulator.yaml#
     unevaluatedProperties: false
     description: smps/ldo regulator nodes(s).
+    properties:
+      regulator-off-on-delay-us: true
     dependencies:
       regulator-allow-set-load: [ regulator-allowed-modes ]
 
Signature · 1 line
2.51.0
maintainer
#3 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 9 lines · Rob Herring
Quoted 3 lines · Saikiran

This property is required for platforms where specific rails (like camera LDOs) rely on passive discharge and need a mandatory off-time constraint enforced by the regulator core.

Does enforcing some off time on all your regulators cause some negative impact on the ones that don't need it? If turning them back on is performance critical maybe don't turn them off in the first place.

You might see something like unexpectedly long delays resuming a runtime suspended device. Generally I'd say that if the delays needed for something like this are long enough for anyone to notice they're long enough to be disruptive.

Having said that I believe an active discharge feature in the hardware has been identified and is being investigated, that's generally a vastly better solution all round so hopefully this change isn't needed at all.

#4 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 11 lines · Mark Brown
Quoted 9 lines · Rob Herring
Quoted 3 lines · Saikiran

This property is required for platforms where specific rails (like camera LDOs) rely on passive discharge and need a mandatory off-time constraint enforced by the regulator core.

Does enforcing some off time on all your regulators cause some negative impact on the ones that don't need it? If turning them back on is performance critical maybe don't turn them off in the first place.

Quoted 8 lines

You might see something like unexpectedly long delays resuming a runtime suspended device. Generally I'd say that if the delays needed for something like this are long enough for anyone to notice they're long enough to be disruptive.

Having said that I believe an active discharge feature in the hardware has been identified and is being investigated, that's generally a vastly better solution all round so hopefully this change isn't needed at all.

+Jishnu, Kamal

Could you please confirm whether our hw can do that?

Konrad

#5 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 17 lines · Konrad Dybcio
Quoted 16 lines · Mark Brown
Quoted 9 lines · Rob Herring
Quoted 3 lines · Saikiran

This property is required for platforms where specific rails (like camera LDOs) rely on passive discharge and need a mandatory off-time constraint enforced by the regulator core.

Does enforcing some off time on all your regulators cause some negative impact on the ones that don't need it? If turning them back on is performance critical maybe don't turn them off in the first place.

You might see something like unexpectedly long delays resuming a runtime suspended device. Generally I'd say that if the delays needed for something like this are long enough for anyone to notice they're long enough to be disruptive.

Quoted 7 lines
Quoted 3 lines

Having said that I believe an active discharge feature in the hardware has been identified and is being investigated, that's generally a vastly better solution all round so hopefully this change isn't needed at all.

+Jishnu, Kamal

Could you please confirm whether our hw can do that?

Yes, we do have setting to enable a strong pull-down to discharge the caps in OFF state, but we dont have the option to enable/disable this from the APPS. However most regulators will have the pull downs are enabled by default (I'll check and confirm about this specific LDOs internally)

But I'm wondering if this is really a 'slow discharge' issue, because if the caps discharge slowly.. shouldn't the rails be turning back ON faster compared to when they are completely discharged (fast discharge case without bulk caps)?

@Saikiran, Just checking if you did some analysis from HW side for this issue.. taking plots? or may be removed the bulk caps on the HW and checked that that issue went away? (or was still their?)

Quoted 2 lines

Konrad

maintainer
#6 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 4 lines · Kamal Wadhwa

But I'm wondering if this is really a 'slow discharge' issue, because if the caps discharge slowly.. shouldn't the rails be turning back ON faster compared to when they are completely discharged (fast discharge case without bulk caps)?

The issue is that some of the supplies fall to a level where they cause disruption to the devices using them but not far enough to put them back into a power on reset state, the device browns out somehow (I'm guessing some retained state is corrupted). Ideally they'd have POR circuits that handle this case well but apparently that's not the case.

#7 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 7 lines · Mark Brown
Quoted 4 lines · Kamal Wadhwa

But I'm wondering if this is really a 'slow discharge' issue, because if the caps discharge slowly.. shouldn't the rails be turning back ON faster compared to when they are completely discharged (fast discharge case without bulk caps)?

Quoted 5 lines

The issue is that some of the supplies fall to a level where they cause disruption to the devices using them but not far enough to put them back into a power on reset state, the device browns out somehow (I'm guessing some retained state is corrupted). Ideally they'd have POR circuits that handle this case well but apparently that's not the case.

I have checked:
- ALL the pm8010 regulators have the PD enabled in OFF state by default.
- From kernel enable/disable of regulator PD settings is not allowed. Its set from the boot and stays as-is later.

But since its already enabled with strong PD, i guess it would not be needed anyway.

Regards,
Kamal

author
#8 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 5 lines · Kamal Wadhwa
Quoted 3 lines · Mark Brown
Quoted 1 line · Kamal Wadhwa

But I'm wondering if this is really a 'slow discharge' issue, because if the

Hi Kamal,

Thanks for checking the internal register defaults.

I can confirm it is definitely related to the power-cycling state. While I haven't probed the pads, I validated this with two software tests:

1. The Always On Test: I modified the driver to keep the regulators permanently enabled (never turning off). In this state, the camera works 100% of the time, even with rapid open/close cycles. This proves the crash is triggered specifically by the power-down event.

2. The Timing Threshold: Through iterative testing, I found that reopening the camera fails consistently if the off-time is <2.0s, but succeeds if the off-time is >2.3s. This 2.3s window matches the calculated RC time constant for a passive discharge on these rails.

If the Strong Pull Down were effectively active, the rails should drain in milliseconds. The fact that it requires 2.3s suggests that on this unit, the PD is either effectively disabled or too weak for the bulk capacitance present.

As I mentioned to Mark, I have withdrawn this specific delay patch to investigate if I can manually enforce Active Discharge (via direct RPMh commands) to solve this at the source. But now, your note that these settings might be locked is concerning.

Quoted 15 lines
Quoted 9 lines
Quoted 3 lines

caps discharge slowly.. shouldn't the rails be turning back ON faster compared to when they are completely discharged (fast discharge case without bulk caps)?

The issue is that some of the supplies fall to a level where they cause disruption to the devices using them but not far enough to put them back into a power on reset state, the device browns out somehow (I'm guessing some retained state is corrupted). Ideally they'd have POR circuits that handle this case well but apparently that's not the case.

I have checked:
- ALL the pm8010 regulators have the PD enabled in OFF state by default.
- From kernel enable/disable of regulator PD settings is not allowed. Its set from the boot and stays as-is later.

Quoted 6 lines

But since its already enabled with strong PD, i guess it would not be needed anyway.

Regards,
Kamal

Regards,
Saikiran

#9 lore raw

Re: [PATCH v3 1/2] dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us

Quoted 30 lines · Saikiran B
Quoted 5 lines · Kamal Wadhwa
Quoted 3 lines · Mark Brown
Quoted 1 line · Kamal Wadhwa

But I'm wondering if this is really a 'slow discharge' issue, because if the

Hi Kamal,

Thanks for checking the internal register defaults.

I can confirm it is definitely related to the power-cycling state. While I haven't probed the pads, I validated this with two software tests:

1. The Always On Test: I modified the driver to keep the regulators permanently enabled (never turning off). In this state, the camera works 100% of the time, even with rapid open/close cycles. This proves the crash is triggered specifically by the power-down event.

2. The Timing Threshold: Through iterative testing, I found that reopening the camera fails consistently if the off-time is <2.0s, but succeeds if the off-time is >2.3s. This 2.3s window matches the calculated RC time constant for a passive discharge on these rails.

If the Strong Pull Down were effectively active, the rails should drain in milliseconds. The fact that it requires 2.3s suggests that on this unit, the PD is either effectively disabled or too weak for the bulk capacitance present.

Quoted 4 lines

As I mentioned to Mark, I have withdrawn this specific delay patch to investigate if I can manually enforce Active Discharge (via direct RPMh commands) to solve this at the source. But now, your note that these settings might be locked is concerning.

I discussed about your concerns, and it seems that we have some boot side DT config that can be configured to enable/disable the strong PD ( its not available from HLOS though)

you can refer to Doc for same here:-
https://docs.qualcomm.com/doc/80-70023-4/topic/tools.html?product=895724676033554725&facet=Boot&version=1.7

forum to ask questions about it:-
https://mysupport.qualcomm.com/supportforums/s/

Quoted 3 lines

Regards,
Saikiran

author
#10 lore raw

PATCH v3 2/2 regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

In reply to Saikiran

The core regulator framework supports enforcing a physical off-time via standard properties, but the qcom-rpmh-regulator driver currently ignores them.

The issue is platform-specific: The Lenovo Yoga Slim 7x (Snapdragon X Elite) has large bulk capacitors on the camera rails (LDO1, LDO3, LDO7). When these regulators are disabled, the voltage decays very slowly (passive discharge).

If the rail is re-enabled before this discharge completes, the sensor experiences a brownout and fails to initialize.

Add support for parsing the 'regulator-off-on-delay-us' property from the device tree to enforce this physical constraint.

---
 drivers/regulator/qcom-rpmh-regulator.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/regulator/qcom-rpmh-regulator.c +3 -0
index 6e4cb2871fca..aafba61551b3 100644
@@ -503,6 +503,9 @@ static int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev,
 	vreg->always_wait_for_ack = of_property_read_bool(node,
 						"qcom,always-wait-for-ack");
 
+	of_property_read_u32(node, "regulator-off-on-delay-us",
+			     &vreg->rdesc.off_on_delay);
+
 	vreg->rdesc.owner	= THIS_MODULE;
 	vreg->rdesc.type	= REGULATOR_VOLTAGE;
 	vreg->rdesc.ops		= vreg->hw_data->ops;
Signature · 1 line
2.51.0
#11 lore raw
In reply to Saikiran
Quoted 24 lines · Saikiran

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Quoted 7 lines

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

Hi Mark, Bjorn, Konrad and all,

We have another UFS issue on QCS8300 RB4 EVK, where it seems this patch is helping.

Issue is seen 2/10 reboots and it happens in the UFS probe defer path:

1. UFS probe takes regulator handle for VCC(vreg_l8a) of UFS host controller.
2. UFS probe enables the regulator
3. UFS probe defers (due to some other dependency un-related to regulator)
4. UFS regulator disabled on probe exit
5. UFS re-attempts probe and re-enables the regulator
6. UFS init sequence runs -> UFS NOP OUT command failed (no shell)

Issue Log:

[    6.583836] ufshcd-qcom 1d84000.ufs: ufshcd_verify_dev_init: NOP OUT failed -11
[    6.592780] ufshcd-qcom 1d84000.ufs: ufshcd_async_scan failed: -11

NOTE
- Issue is not seen in first probe attempt, because UFS regulators are left ON from bootloader, which gives enough time between rail turn ON and UFS init sequence start. However in issue case, it seems re-probe is happening too fast, which causes init sequence to fail and UFS brownouts (similar to camera sensor case)

- Also, we compared this board with other RBxx EVK boards for UFS rail, it seems that this board has more caps on the VCC regulator, as the board is designed to have both EMMC and UFS, and we have DT option to pick one of them.

So for EMMC those extra caps were added and they are impacting rampup on VCC.

Since this is not entirely a UFS part issue, but a board design constraint, it seems better if we handle this in the regulator side itself, as adding it in the UFS driver may not be acceptable from UFS reviewers.

Please share your opinion, if this seems to be good reason to accept this patch?

Regards,
Kamal

#12 lore raw
Quoted 63 lines · Kamal Wadhwa
Quoted 24 lines · Saikiran

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Quoted 7 lines

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

Hi Mark, Bjorn, Konrad and all,

We have another UFS issue on QCS8300 RB4 EVK, where it seems this patch is helping.

Issue is seen 2/10 reboots and it happens in the UFS probe defer path:

1. UFS probe takes regulator handle for VCC(vreg_l8a) of UFS host controller.
2. UFS probe enables the regulator
3. UFS probe defers (due to some other dependency un-related to regulator)
4. UFS regulator disabled on probe exit
5. UFS re-attempts probe and re-enables the regulator
6. UFS init sequence runs -> UFS NOP OUT command failed (no shell)

Issue Log:

[    6.583836] ufshcd-qcom 1d84000.ufs: ufshcd_verify_dev_init: NOP OUT failed -11
[    6.592780] ufshcd-qcom 1d84000.ufs: ufshcd_async_scan failed: -11

NOTE
- Issue is not seen in first probe attempt, because UFS regulators are left ON from bootloader, which gives enough time between rail turn ON and UFS init sequence start. However in issue case, it seems re-probe is happening too fast, which causes init sequence to fail and UFS brownouts (similar to camera sensor case)

- Also, we compared this board with other RBxx EVK boards for UFS rail, it seems that this board has more caps on the VCC regulator, as the board is designed to have both EMMC and UFS, and we have DT option to pick one of them.

Quoted 7 lines

So for EMMC those extra caps were added and they are impacting rampup on VCC.

Since this is not entirely a UFS part issue, but a board design constraint, it seems better if we handle this in the regulator side itself, as adding it in the UFS driver may not be acceptable from UFS reviewers.

Please share your opinion, if this seems to be good reason to accept this patch?

Is that board in production already, or is that something that can be fixed?

Konrad

#13 lore raw
Quoted 66 lines · Konrad Dybcio
Quoted 65 lines · Kamal Wadhwa
Quoted 24 lines · Saikiran

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Quoted 7 lines

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

Hi Mark, Bjorn, Konrad and all,

We have another UFS issue on QCS8300 RB4 EVK, where it seems this patch is helping.

Issue is seen 2/10 reboots and it happens in the UFS probe defer path:

1. UFS probe takes regulator handle for VCC(vreg_l8a) of UFS host controller.
2. UFS probe enables the regulator
3. UFS probe defers (due to some other dependency un-related to regulator)
4. UFS regulator disabled on probe exit
5. UFS re-attempts probe and re-enables the regulator
6. UFS init sequence runs -> UFS NOP OUT command failed (no shell)

Issue Log:

[    6.583836] ufshcd-qcom 1d84000.ufs: ufshcd_verify_dev_init: NOP OUT failed -11
[    6.592780] ufshcd-qcom 1d84000.ufs: ufshcd_async_scan failed: -11

NOTE
- Issue is not seen in first probe attempt, because UFS regulators are left ON from bootloader, which gives enough time between rail turn ON and UFS init sequence start. However in issue case, it seems re-probe is happening too fast, which causes init sequence to fail and UFS brownouts (similar to camera sensor case)

- Also, we compared this board with other RBxx EVK boards for UFS rail, it seems that this board has more caps on the VCC regulator, as the board is designed to have both EMMC and UFS, and we have DT option to pick one of them.

So for EMMC those extra caps were added and they are impacting rampup on VCC.

Quoted 7 lines
Quoted 5 lines

Since this is not entirely a UFS part issue, but a board design constraint, it seems better if we handle this in the regulator side itself, as adding it in the UFS driver may not be acceptable from UFS reviewers.

Please share your opinion, if this seems to be good reason to accept this patch?

Is that board in production already, or is that something that can be fixed?

yes, it cannot be fixed in HW, as the board is already in production.

Quoted 2 lines

Konrad

#14 lore raw
Quoted 71 lines · Kamal Wadhwa
Quoted 70 lines · Konrad Dybcio
Quoted 69 lines · Kamal Wadhwa
Quoted 24 lines · Saikiran

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Quoted 7 lines

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

Hi Mark, Bjorn, Konrad and all,

We have another UFS issue on QCS8300 RB4 EVK, where it seems this patch is helping.

Issue is seen 2/10 reboots and it happens in the UFS probe defer path:

1. UFS probe takes regulator handle for VCC(vreg_l8a) of UFS host controller.
2. UFS probe enables the regulator
3. UFS probe defers (due to some other dependency un-related to regulator)
4. UFS regulator disabled on probe exit
5. UFS re-attempts probe and re-enables the regulator
6. UFS init sequence runs -> UFS NOP OUT command failed (no shell)

Issue Log:

[    6.583836] ufshcd-qcom 1d84000.ufs: ufshcd_verify_dev_init: NOP OUT failed -11
[    6.592780] ufshcd-qcom 1d84000.ufs: ufshcd_async_scan failed: -11

NOTE
- Issue is not seen in first probe attempt, because UFS regulators are left ON from bootloader, which gives enough time between rail turn ON and UFS init sequence start. However in issue case, it seems re-probe is happening too fast, which causes init sequence to fail and UFS brownouts (similar to camera sensor case)

- Also, we compared this board with other RBxx EVK boards for UFS rail, it seems that this board has more caps on the VCC regulator, as the board is designed to have both EMMC and UFS, and we have DT option to pick one of them.

So for EMMC those extra caps were added and they are impacting rampup on VCC.

Since this is not entirely a UFS part issue, but a board design constraint, it seems better if we handle this in the regulator side itself, as adding it in the UFS driver may not be acceptable from UFS reviewers.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Please share your opinion, if this seems to be good reason to accept this patch?

Is that board in production already, or is that something that can be fixed?

yes, it cannot be fixed in HW, as the board is already in production.

Re-reading this thread, RobH's worry here:

https://lore.kernel.org/all/[email protected]/

seems to be misguided - AFAICU this property would be set on each regulator separately, not globally for all regulators under a given PMIC - is that right?

In that case, I see no real downside in allowing that, especially given it would/should be used sparingly and only in cases like you mentioned where the board has some quirks

Konrad

#15 lore raw
Quoted 78 lines · Konrad Dybcio
Quoted 71 lines · Kamal Wadhwa
Quoted 70 lines · Konrad Dybcio
Quoted 69 lines · Kamal Wadhwa
Quoted 24 lines · Saikiran

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Quoted 7 lines

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

Hi Mark, Bjorn, Konrad and all,

We have another UFS issue on QCS8300 RB4 EVK, where it seems this patch is helping.

Issue is seen 2/10 reboots and it happens in the UFS probe defer path:

1. UFS probe takes regulator handle for VCC(vreg_l8a) of UFS host controller.
2. UFS probe enables the regulator
3. UFS probe defers (due to some other dependency un-related to regulator)
4. UFS regulator disabled on probe exit
5. UFS re-attempts probe and re-enables the regulator
6. UFS init sequence runs -> UFS NOP OUT command failed (no shell)

Issue Log:

[    6.583836] ufshcd-qcom 1d84000.ufs: ufshcd_verify_dev_init: NOP OUT failed -11
[    6.592780] ufshcd-qcom 1d84000.ufs: ufshcd_async_scan failed: -11

NOTE
- Issue is not seen in first probe attempt, because UFS regulators are left ON from bootloader, which gives enough time between rail turn ON and UFS init sequence start. However in issue case, it seems re-probe is happening too fast, which causes init sequence to fail and UFS brownouts (similar to camera sensor case)

- Also, we compared this board with other RBxx EVK boards for UFS rail, it seems that this board has more caps on the VCC regulator, as the board is designed to have both EMMC and UFS, and we have DT option to pick one of them.

So for EMMC those extra caps were added and they are impacting rampup on VCC.

Since this is not entirely a UFS part issue, but a board design constraint, it seems better if we handle this in the regulator side itself, as adding it in the UFS driver may not be acceptable from UFS reviewers.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Please share your opinion, if this seems to be good reason to accept this patch?

Is that board in production already, or is that something that can be fixed?

yes, it cannot be fixed in HW, as the board is already in production.

Quoted 7 lines

Re-reading this thread, RobH's worry here:

https://lore.kernel.org/all/[email protected]/

seems to be misguided - AFAICU this property would be set on each regulator separately, not globally for all regulators under a given PMIC - is that right?

Yes, this is per-regulator and not globally applied.

Quoted 4 lines

In that case, I see no real downside in allowing that, especially given it would/should be used sparingly and only in cases like you mentioned where the board has some quirks

yes. we can use this sparingly for such board issues.

@Mark, @Rob - can you please comment if you think this is acceptable?

Quoted 2 lines

Konrad

maintainer
#16 lore raw
Quoted 9 lines · Kamal Wadhwa
Quoted 3 lines · Konrad Dybcio

In that case, I see no real downside in allowing that, especially given it would/should be used sparingly and only in cases like you mentioned where the board has some quirks

yes. we can use this sparingly for such board issues.

@Mark, @Rob - can you please comment if you think this is acceptable?

Could you please ask a specific question? What is "this" here? There is an large amount of quoted material in the message and referencs to some property but I'm not clear which one.

Please also do not add random extra characters to my name, and also you've CCed [email protected] which appears invalid.

#17 lore raw
Quoted 7 lines · Mark Brown
Quoted 5 lines · Kamal Wadhwa
Quoted 3 lines · Konrad Dybcio

In that case, I see no real downside in allowing that, especially given it would/should be used sparingly and only in cases like you mentioned where the board has some quirks

Quoted 7 lines
Quoted 3 lines

yes. we can use this sparingly for such board issues.

@Mark, @Rob - can you please comment if you think this is acceptable?

Could you please ask a specific question? What is "this" here? There is an large amount of quoted material in the message and referencs to some property but I'm not clear which one.

I'm sorry.
let me elaborate.

Saikiran had posted this patch series which introduced a "regulator-off-on-delay-us" property to qcom-rpmh-regulator.c for "Lenovo Yoga Slim 7x (Snapdragon X Elite)". But after discussions with you and Rob, he decided to use an alternative approach and not pursue this patch
https://lore.kernel.org/all/[email protected]/

However recently on Qualcomm's QCS8300 RB4 boards we started seeing "NOP OUT" issue for UFS driver, where this patch seems to be helping.

The issue was seen only when a quick Off->On operation happened due to defer and re-probe of the UFS driver (note - defer was due to some other reasons unrelated to regulator), combined with the extra caps on the boards, as UFS and EMMC (which needed more caps) shared same rails led to this situation.

While analyzing the issue it was found that adding a delay between the regulator Off->On operation helps the UFS work properly, allowing more time for the rail to go down.

Since the boards are already in production and the HW design cannot be changed, we'd like your opinion on whether this patch can be taken in its current form.

Also, Rob had earlier raised a few points to Saikiran on this patch series
(https://lore.kernel.org/all/[email protected]/):

1. About calling "regulator-off-on-delay-us" a "standard" property (which is not correct)
2. If this property will force the off-on-delay on all the regulators under the pmic
3. If we can avoid turning the regulator off itself, so we may not need this delay

point 1 - I can fix in the v2, by correcting the commit message.

point 2 - As I confirmed to Konrad above, the property is per-regulator, so other regulators under the same driver will not be impacted.

point 3 - We evaluated this for UFS - but the problem is that the issue happens in the defer probe path, so if we avoid turning off the regulator, it leads to long error prints appearing for the regulator being left ON. So we couldn't take that path.

You may also refer to this
https://lore.kernel.org/all/[email protected]/
for a more detailed flow of the issue from the UFS perspective.

Quoted 3 lines

Please also do not add random extra characters to my name, and also you've CCed [email protected] which appears invalid.

sorry for this, it seems by mistake i added . there.

maintainer
#18 lore raw

On Wed, Sep 09, 2026 at 02:34:21AM +0530, Kamal Wadhwa wrote:

Please fix your mail client to word wrap within paragraphs at something substantially less than 80 columns. Doing this makes your messages much easier to read and reply to.

Quoted 6 lines

However recently on Qualcomm's QCS8300 RB4 boards we started seeing "NOP OUT" issue for UFS driver, where this patch seems to be helping.

Also, Rob had earlier raised a few points to Saikiran on this patch series
(https://lore.kernel.org/all/[email protected]/):

Quoted 6 lines

3. If we can avoid turning the regulator off itself, so we may not need this delay

point 3 - We evaluated this for UFS - but the problem is that the issue happens in the defer probe path, so if we avoid turning off the regulator, it leads to long error prints appearing for the regulator being left ON. So we couldn't take that path.

I think Rob might be thinking here of something like the runtime PM autosuspend delay where once the final reference is dropped we wait some time before we actually implement the power off in hardware, thus a quick power cycle would never actually get implemented. That does sound like a good idea if we've got issues with quick cycling, obviously the actual delay would still be needed but if you've got quick bounces happening routinely then a delay like that would allow you to avoid both power off and ramp delays.

#19 lore raw

Hi Mark,

Quoted 2 lines · Mark Brown

On Wed, Sep 09, 2026 at 02:34:21AM +0530, Kamal Wadhwa wrote:

...>

Quoted 7 lines
Quoted 6 lines

3. If we can avoid turning the regulator off itself, so we may not need this delay

point 3 - We evaluated this for UFS - but the problem is that the issue happens in the defer probe path, so if we avoid turning off the regulator, it leads to long error prints appearing for the regulator being left ON. So we couldn't take that path.

Quoted 8 lines

I think Rob might be thinking here of something like the runtime PM autosuspend delay where once the final reference is dropped we wait some time before we actually implement the power off in hardware, thus a quick power cycle would never actually get implemented. That does sound like a good idea if we've got issues with quick cycling, obviously the actual delay would still be needed but if you've got quick bounces happening routinely then a delay like that would allow you to avoid both power off and ramp delays.

I'm working with Kamal for upstreaming this series.

If I understand you correctly, instead of the approach in this driver change (only setting the existing variable "off_on_delay"), you prefer having a sequence somewhat like this:

1. Regulator (if configured in DT for this new behaviour) gets disable vote from its last enabled consumer
2. Delay timer is started
3. If regulator gets enable vote before timer expires (quick bounce), clear timer and return without touching regulator HW
4. Else, disable regulator when timer expires

Is this what you meant?

If the above sequence is right, where would you prefer it to be implemented, in the regulator core file or our regulator driver file?

Thanks,
Jishnu

maintainer
#20 lore raw
Quoted 25 lines · Jishnu Prakash
Quoted 9 lines · Mark Brown
Quoted 6 lines · Kamal Wadhwa

3. If we can avoid turning the regulator off itself, so we may not need this delay

point 3 - We evaluated this for UFS - but the problem is that the issue happens in the defer probe path, so if we avoid turning off the regulator, it leads to long error prints appearing for the regulator being left ON. So we couldn't take that path.

Quoted 8 lines

I think Rob might be thinking here of something like the runtime PM autosuspend delay where once the final reference is dropped we wait some time before we actually implement the power off in hardware, thus a quick power cycle would never actually get implemented. That does sound like a good idea if we've got issues with quick cycling, obviously the actual delay would still be needed but if you've got quick bounces happening routinely then a delay like that would allow you to avoid both power off and ramp delays.

I'm working with Kamal for upstreaming this series.

If I understand you correctly, instead of the approach in this driver change (only setting the existing variable "off_on_delay"), you prefer having a sequence somewhat like this:

Quoted 8 lines

1. Regulator (if configured in DT for this new behaviour) gets disable vote from its last enabled consumer
2. Delay timer is started
3. If regulator gets enable vote before timer expires (quick bounce), clear timer and return without touching regulator HW
4. Else, disable regulator when timer expires

Is this what you meant?

That's what I understand Rob's suggestion to be. Like I say that would still need any minimum off time enforcement.

Quoted 7 lines

If the above sequence is right, where would you prefer it to be implemented, in the regulator core file or our regulator driver file?

Thanks,
Jishnu

#21 lore raw
In reply to Kamal Wadhwa
Quoted 63 lines · Kamal Wadhwa
Quoted 24 lines · Saikiran

This series adds support for the standard regulator-off-on-delay-us property to the Qualcomm RPMh regulator driver and updates the corresponding Device Tree bindings.

Motivation:
On the Lenovo Yoga Slim 7x (Snapdragon X Elite), the camera regulators (LDO1, LDO3, LDO7) have large bulk capacitors and rely on passive discharge. When these regulators are disabled, the voltage decays very slowly. If re-enabled too quickly, the sensor experiences a brownout and fails to initialize.

Verification:
I verified that the core drivers/regulator/of_regulator.c does not currently parse regulator-off-on-delay-us in of_get_regulation_constraints(). Therefore, the driver must parse this property explicitly and populate rdesc->off_on_delay so the regulator core can enforce the constraint.

Changes in v3:
- Added Patch 1/2: Update DT bindings to allow regulator-off-on-delay-us for qcom,rpmh-regulator (Requested by Mark Brown).
- Updated Patch 2/2: Refined commit message to explicitly mention the passive discharge and bulk capacitor mechanism on the Yoga Slim 7x (Requested by Mark Brown).

Quoted 7 lines

Changes in v2:
- Moved the motivation/context from the cover letter into the commit message of the driver patch.

Saikiran (2):
dt-bindings: regulator: qcom,rpmh: Allow regulator-off-on-delay-us
regulator: qcom-rpmh: Add support for regulator-off-on-delay-us

Hi Mark, Bjorn, Konrad and all,

We have another UFS issue on QCS8300 RB4 EVK, where it seems this patch is helping.

Issue is seen 2/10 reboots and it happens in the UFS probe defer path:

1. UFS probe takes regulator handle for VCC(vreg_l8a) of UFS host controller.
2. UFS probe enables the regulator
3. UFS probe defers (due to some other dependency un-related to regulator)
4. UFS regulator disabled on probe exit
5. UFS re-attempts probe and re-enables the regulator
6. UFS init sequence runs -> UFS NOP OUT command failed (no shell)

Issue Log:

[    6.583836] ufshcd-qcom 1d84000.ufs: ufshcd_verify_dev_init: NOP OUT failed -11
[    6.592780] ufshcd-qcom 1d84000.ufs: ufshcd_async_scan failed: -11

NOTE
- Issue is not seen in first probe attempt, because UFS regulators are left ON from bootloader, which gives enough time between rail turn ON and UFS init sequence start. However in issue case, it seems re-probe is happening too fast, which causes init sequence to fail and UFS brownouts (similar to camera sensor case)

- Also, we compared this board with other RBxx EVK boards for UFS rail, it seems that this board has more caps on the VCC regulator, as the board is designed to have both EMMC and UFS, and we have DT option to pick one of them.

Quoted 6 lines

So for EMMC those extra caps were added and they are impacting rampup on VCC.

Since this is not entirely a UFS part issue, but a board design constraint, it seems better if we handle this in the regulator side itself, as adding it in the UFS driver may not be acceptable from UFS reviewers.

Ofc. UFS driver shouldn't deal with this board specific regulator constraint. Please work on addressing Rob's concern to take this series forward.

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்