[PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750

Nitin Rawat posted 2 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 2 weeks ago
Add regulator load voting support for SM8650 and SM8750 platforms by
introducing dedicated regulator bulk data arrays with their load
values.

The load requirements are:
- SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
- SM8750: vdda-phy (213mA), vdda-pll (18.3mA)

This ensures stable operation and proper power management for these
platforms where regulators are shared between the QMP USB PHY and
other IP blocks by setting appropriate regulator load currents during PHY
operations.

Configurations without specific load requirements will continue to work
unchanged, as init_load_uA remains zero-initialized when .init_load_uA
is not provided.

Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
index aaa88ca0ef07..1c3ce0fa6adf 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
@@ -1170,6 +1170,17 @@ static const struct regulator_bulk_data qmp_phy_vreg_l[] = {
 	{ .supply = "vdda-pll" },
 };

+/* Regulator bulk data with load values for specific configurations */
+static const struct regulator_bulk_data sm8650_ufsphy_vreg_l[] = {
+	{ .supply = "vdda-phy", .init_load_uA = 205000 },
+	{ .supply = "vdda-pll", .init_load_uA = 17500 },
+};
+
+static const struct regulator_bulk_data sm8750_ufsphy_vreg_l[] = {
+	{ .supply = "vdda-phy", .init_load_uA = 213000 },
+	{ .supply = "vdda-pll", .init_load_uA = 18300 },
+};
+
 static const struct qmp_ufs_offsets qmp_ufs_offsets = {
 	.serdes		= 0,
 	.pcs		= 0xc00,
@@ -1638,8 +1649,8 @@ static const struct qmp_phy_cfg sm8650_ufsphy_cfg = {
 		.max_gear	= UFS_HS_G5,
 	},

-	.vreg_list		= qmp_phy_vreg_l,
-	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.vreg_list		= sm8650_ufsphy_vreg_l,
+	.num_vregs		= ARRAY_SIZE(sm8650_ufsphy_vreg_l),
 	.regs			= ufsphy_v6_regs_layout,
 };

@@ -1676,8 +1687,8 @@ static const struct qmp_phy_cfg sm8750_ufsphy_cfg = {
 		.max_gear	= UFS_HS_G5,
 	},

-	.vreg_list		= qmp_phy_vreg_l,
-	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.vreg_list		= sm8750_ufsphy_vreg_l,
+	.num_vregs		= ARRAY_SIZE(sm8750_ufsphy_vreg_l),
 	.regs			= ufsphy_v6_regs_layout,

 };
--
2.48.1
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Manivannan Sadhasivam 1 month, 1 week ago
On Wed, Aug 20, 2025 at 03:58:26AM GMT, Nitin Rawat wrote:
> Add regulator load voting support for SM8650 and SM8750 platforms by
> introducing dedicated regulator bulk data arrays with their load
> values.
> 
> The load requirements are:
> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
> 
> This ensures stable operation and proper power management for these
> platforms where regulators are shared between the QMP USB PHY and
> other IP blocks by setting appropriate regulator load currents during PHY
> operations.
> 

So it is fixing stability issues on these platforms. Hence, 'Fixes' tag pointing
to the commits that added these platform support should be added.

> Configurations without specific load requirements will continue to work
> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
> is not provided.
> 
> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>

Reviewed-by: Manivannan Sadhasivam <mani@kernel.org>

- Mani

> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> index aaa88ca0ef07..1c3ce0fa6adf 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> @@ -1170,6 +1170,17 @@ static const struct regulator_bulk_data qmp_phy_vreg_l[] = {
>  	{ .supply = "vdda-pll" },
>  };
> 
> +/* Regulator bulk data with load values for specific configurations */
> +static const struct regulator_bulk_data sm8650_ufsphy_vreg_l[] = {
> +	{ .supply = "vdda-phy", .init_load_uA = 205000 },
> +	{ .supply = "vdda-pll", .init_load_uA = 17500 },
> +};
> +
> +static const struct regulator_bulk_data sm8750_ufsphy_vreg_l[] = {
> +	{ .supply = "vdda-phy", .init_load_uA = 213000 },
> +	{ .supply = "vdda-pll", .init_load_uA = 18300 },
> +};
> +
>  static const struct qmp_ufs_offsets qmp_ufs_offsets = {
>  	.serdes		= 0,
>  	.pcs		= 0xc00,
> @@ -1638,8 +1649,8 @@ static const struct qmp_phy_cfg sm8650_ufsphy_cfg = {
>  		.max_gear	= UFS_HS_G5,
>  	},
> 
> -	.vreg_list		= qmp_phy_vreg_l,
> -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
> +	.vreg_list		= sm8650_ufsphy_vreg_l,
> +	.num_vregs		= ARRAY_SIZE(sm8650_ufsphy_vreg_l),
>  	.regs			= ufsphy_v6_regs_layout,
>  };
> 
> @@ -1676,8 +1687,8 @@ static const struct qmp_phy_cfg sm8750_ufsphy_cfg = {
>  		.max_gear	= UFS_HS_G5,
>  	},
> 
> -	.vreg_list		= qmp_phy_vreg_l,
> -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
> +	.vreg_list		= sm8750_ufsphy_vreg_l,
> +	.num_vregs		= ARRAY_SIZE(sm8750_ufsphy_vreg_l),
>  	.regs			= ufsphy_v6_regs_layout,
> 
>  };
> --
> 2.48.1
> 

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Dmitry Baryshkov 1 month, 2 weeks ago
On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
> Add regulator load voting support for SM8650 and SM8750 platforms by
> introducing dedicated regulator bulk data arrays with their load
> values.
> 
> The load requirements are:
> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
> 
> This ensures stable operation and proper power management for these
> platforms where regulators are shared between the QMP USB PHY and
> other IP blocks by setting appropriate regulator load currents during PHY
> operations.
> 
> Configurations without specific load requirements will continue to work
> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
> is not provided.

Can we please get configuration for the rest of the platforms?

> 
> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 19 +++++++++++++++----
>  1 file changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> index aaa88ca0ef07..1c3ce0fa6adf 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> @@ -1170,6 +1170,17 @@ static const struct regulator_bulk_data qmp_phy_vreg_l[] = {
>  	{ .supply = "vdda-pll" },
>  };
> 
> +/* Regulator bulk data with load values for specific configurations */
> +static const struct regulator_bulk_data sm8650_ufsphy_vreg_l[] = {
> +	{ .supply = "vdda-phy", .init_load_uA = 205000 },
> +	{ .supply = "vdda-pll", .init_load_uA = 17500 },
> +};
> +
> +static const struct regulator_bulk_data sm8750_ufsphy_vreg_l[] = {
> +	{ .supply = "vdda-phy", .init_load_uA = 213000 },
> +	{ .supply = "vdda-pll", .init_load_uA = 18300 },
> +};
> +
>  static const struct qmp_ufs_offsets qmp_ufs_offsets = {
>  	.serdes		= 0,
>  	.pcs		= 0xc00,
> @@ -1638,8 +1649,8 @@ static const struct qmp_phy_cfg sm8650_ufsphy_cfg = {
>  		.max_gear	= UFS_HS_G5,
>  	},
> 
> -	.vreg_list		= qmp_phy_vreg_l,
> -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
> +	.vreg_list		= sm8650_ufsphy_vreg_l,
> +	.num_vregs		= ARRAY_SIZE(sm8650_ufsphy_vreg_l),
>  	.regs			= ufsphy_v6_regs_layout,
>  };
> 
> @@ -1676,8 +1687,8 @@ static const struct qmp_phy_cfg sm8750_ufsphy_cfg = {
>  		.max_gear	= UFS_HS_G5,
>  	},
> 
> -	.vreg_list		= qmp_phy_vreg_l,
> -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
> +	.vreg_list		= sm8750_ufsphy_vreg_l,
> +	.num_vregs		= ARRAY_SIZE(sm8750_ufsphy_vreg_l),
>  	.regs			= ufsphy_v6_regs_layout,
> 
>  };
> --
> 2.48.1
> 

-- 
With best wishes
Dmitry
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Manivannan Sadhasivam 1 month, 1 week ago
On Wed, Aug 20, 2025 at 03:49:31AM GMT, Dmitry Baryshkov wrote:
> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
> > Add regulator load voting support for SM8650 and SM8750 platforms by
> > introducing dedicated regulator bulk data arrays with their load
> > values.
> > 
> > The load requirements are:
> > - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
> > - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
> > 
> > This ensures stable operation and proper power management for these
> > platforms where regulators are shared between the QMP USB PHY and
> > other IP blocks by setting appropriate regulator load currents during PHY
> > operations.
> > 
> > Configurations without specific load requirements will continue to work
> > unchanged, as init_load_uA remains zero-initialized when .init_load_uA
> > is not provided.
> 
> Can we please get configuration for the rest of the platforms?
> 

Only if the rest of the platforms require setting the load... It is not very
clear if the older platforms share the regulators with other IPs or not.

- Mani

> > 
> > Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
> > ---
> >  drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 19 +++++++++++++++----
> >  1 file changed, 15 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > index aaa88ca0ef07..1c3ce0fa6adf 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
> > @@ -1170,6 +1170,17 @@ static const struct regulator_bulk_data qmp_phy_vreg_l[] = {
> >  	{ .supply = "vdda-pll" },
> >  };
> > 
> > +/* Regulator bulk data with load values for specific configurations */
> > +static const struct regulator_bulk_data sm8650_ufsphy_vreg_l[] = {
> > +	{ .supply = "vdda-phy", .init_load_uA = 205000 },
> > +	{ .supply = "vdda-pll", .init_load_uA = 17500 },
> > +};
> > +
> > +static const struct regulator_bulk_data sm8750_ufsphy_vreg_l[] = {
> > +	{ .supply = "vdda-phy", .init_load_uA = 213000 },
> > +	{ .supply = "vdda-pll", .init_load_uA = 18300 },
> > +};
> > +
> >  static const struct qmp_ufs_offsets qmp_ufs_offsets = {
> >  	.serdes		= 0,
> >  	.pcs		= 0xc00,
> > @@ -1638,8 +1649,8 @@ static const struct qmp_phy_cfg sm8650_ufsphy_cfg = {
> >  		.max_gear	= UFS_HS_G5,
> >  	},
> > 
> > -	.vreg_list		= qmp_phy_vreg_l,
> > -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
> > +	.vreg_list		= sm8650_ufsphy_vreg_l,
> > +	.num_vregs		= ARRAY_SIZE(sm8650_ufsphy_vreg_l),
> >  	.regs			= ufsphy_v6_regs_layout,
> >  };
> > 
> > @@ -1676,8 +1687,8 @@ static const struct qmp_phy_cfg sm8750_ufsphy_cfg = {
> >  		.max_gear	= UFS_HS_G5,
> >  	},
> > 
> > -	.vreg_list		= qmp_phy_vreg_l,
> > -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
> > +	.vreg_list		= sm8750_ufsphy_vreg_l,
> > +	.num_vregs		= ARRAY_SIZE(sm8750_ufsphy_vreg_l),
> >  	.regs			= ufsphy_v6_regs_layout,
> > 
> >  };
> > --
> > 2.48.1
> > 
> 
> -- 
> With best wishes
> Dmitry

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Dmitry Baryshkov 1 month, 1 week ago
On 22/08/2025 11:53, Manivannan Sadhasivam wrote:
> On Wed, Aug 20, 2025 at 03:49:31AM GMT, Dmitry Baryshkov wrote:
>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>> introducing dedicated regulator bulk data arrays with their load
>>> values.
>>>
>>> The load requirements are:
>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>
>>> This ensures stable operation and proper power management for these
>>> platforms where regulators are shared between the QMP USB PHY and
>>> other IP blocks by setting appropriate regulator load currents during PHY
>>> operations.
>>>
>>> Configurations without specific load requirements will continue to work
>>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>>> is not provided.
>>
>> Can we please get configuration for the rest of the platforms?
>>
> 
> Only if the rest of the platforms require setting the load... It is not very
> clear if the older platforms share the regulators with other IPs or not.

Yes, they are usually shared. USB. PCIe and DSI frequently sit on the 
same voltage rails.


-- 
With best wishes
Dmitry
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 1 week ago

On 8/22/2025 2:45 PM, Dmitry Baryshkov wrote:
> On 22/08/2025 11:53, Manivannan Sadhasivam wrote:
>> On Wed, Aug 20, 2025 at 03:49:31AM GMT, Dmitry Baryshkov wrote:
>>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>>> introducing dedicated regulator bulk data arrays with their load
>>>> values.
>>>>
>>>> The load requirements are:
>>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>>
>>>> This ensures stable operation and proper power management for these
>>>> platforms where regulators are shared between the QMP USB PHY and
>>>> other IP blocks by setting appropriate regulator load currents 
>>>> during PHY
>>>> operations.
>>>>
>>>> Configurations without specific load requirements will continue to work
>>>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>>>> is not provided.
>>>
>>> Can we please get configuration for the rest of the platforms?
>>>
>>
>> Only if the rest of the platforms require setting the load... It is 
>> not very
>> clear if the older platforms share the regulators with other IPs or not.
> 
> Yes, they are usually shared. USB. PCIe and DSI frequently sit on the 
> same voltage rails.

Yes, it’s typically shared across multiple clients.

However, as I mentioned earlier, in the current upstream codebase, the 
"regulator-allow-set-load" property is defined only for SM8750 and 
SM8650 within the PMIC PHY and PLL device tree nodes. This means that 
even if the UFS PHY driver is updated to vote for this configuration on 
other platforms, it will have no effect, as the property is not 
supported there.


> 
> 

Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Manivannan Sadhasivam 1 month, 1 week ago
On Fri, Aug 22, 2025 at 02:53:31PM GMT, Nitin Rawat wrote:
> 
> 
> On 8/22/2025 2:45 PM, Dmitry Baryshkov wrote:
> > On 22/08/2025 11:53, Manivannan Sadhasivam wrote:
> > > On Wed, Aug 20, 2025 at 03:49:31AM GMT, Dmitry Baryshkov wrote:
> > > > On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
> > > > > Add regulator load voting support for SM8650 and SM8750 platforms by
> > > > > introducing dedicated regulator bulk data arrays with their load
> > > > > values.
> > > > > 
> > > > > The load requirements are:
> > > > > - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
> > > > > - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
> > > > > 
> > > > > This ensures stable operation and proper power management for these
> > > > > platforms where regulators are shared between the QMP USB PHY and
> > > > > other IP blocks by setting appropriate regulator load
> > > > > currents during PHY
> > > > > operations.
> > > > > 
> > > > > Configurations without specific load requirements will continue to work
> > > > > unchanged, as init_load_uA remains zero-initialized when .init_load_uA
> > > > > is not provided.
> > > > 
> > > > Can we please get configuration for the rest of the platforms?
> > > > 
> > > 
> > > Only if the rest of the platforms require setting the load... It is
> > > not very
> > > clear if the older platforms share the regulators with other IPs or not.
> > 
> > Yes, they are usually shared. USB. PCIe and DSI frequently sit on the
> > same voltage rails.
> 
> Yes, it’s typically shared across multiple clients.
> 
> However, as I mentioned earlier, in the current upstream codebase, the
> "regulator-allow-set-load" property is defined only for SM8750 and SM8650
> within the PMIC PHY and PLL device tree nodes. This means that even if the
> UFS PHY driver is updated to vote for this configuration on other platforms,
> it will have no effect, as the property is not supported there.
> 

Which means:

1. Those platforms are still prone to this stability issue.
2. Only UFS is setting the regulator constraint, but not other drivers sharing
the same regulator.

IMO, both cases are bad. At leat, you can update the UFS driver to set the load
now and later on add the DTS property as a follow-up series for those platforms.

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 1 week ago

On 8/22/2025 4:26 PM, Manivannan Sadhasivam wrote:
> On Fri, Aug 22, 2025 at 02:53:31PM GMT, Nitin Rawat wrote:
>>
>>
>> On 8/22/2025 2:45 PM, Dmitry Baryshkov wrote:
>>> On 22/08/2025 11:53, Manivannan Sadhasivam wrote:
>>>> On Wed, Aug 20, 2025 at 03:49:31AM GMT, Dmitry Baryshkov wrote:
>>>>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>>>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>>>>> introducing dedicated regulator bulk data arrays with their load
>>>>>> values.
>>>>>>
>>>>>> The load requirements are:
>>>>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>>>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>>>>
>>>>>> This ensures stable operation and proper power management for these
>>>>>> platforms where regulators are shared between the QMP USB PHY and
>>>>>> other IP blocks by setting appropriate regulator load
>>>>>> currents during PHY
>>>>>> operations.
>>>>>>
>>>>>> Configurations without specific load requirements will continue to work
>>>>>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>>>>>> is not provided.
>>>>>
>>>>> Can we please get configuration for the rest of the platforms?
>>>>>
>>>>
>>>> Only if the rest of the platforms require setting the load... It is
>>>> not very
>>>> clear if the older platforms share the regulators with other IPs or not.
>>>
>>> Yes, they are usually shared. USB. PCIe and DSI frequently sit on the
>>> same voltage rails.
>>
>> Yes, it’s typically shared across multiple clients.
>>
>> However, as I mentioned earlier, in the current upstream codebase, the
>> "regulator-allow-set-load" property is defined only for SM8750 and SM8650
>> within the PMIC PHY and PLL device tree nodes. This means that even if the
>> UFS PHY driver is updated to vote for this configuration on other platforms,
>> it will have no effect, as the property is not supported there.
>>
> 
> Which means:
> 
> 1. Those platforms are still prone to this stability issue.
> 2. Only UFS is setting the regulator constraint, but not other drivers sharing
> the same regulator.

You understanding is correct.

> 
> IMO, both cases are bad. At leat, you can update the UFS driver to set the load
> now and later on add the DTS property as a follow-up series for those platforms.


sure will take care of this.>
> - Mani



> 

Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 2 weeks ago

On 8/20/2025 6:19 AM, Dmitry Baryshkov wrote:
> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>> Add regulator load voting support for SM8650 and SM8750 platforms by
>> introducing dedicated regulator bulk data arrays with their load
>> values.
>>
>> The load requirements are:
>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>
>> This ensures stable operation and proper power management for these
>> platforms where regulators are shared between the QMP USB PHY and
>> other IP blocks by setting appropriate regulator load currents during PHY
>> operations.
>>
>> Configurations without specific load requirements will continue to work
>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>> is not provided.
> 
> Can we please get configuration for the rest of the platforms?

Hi Dmitry,

If you're okay with it, can I merge the configuration for the remaining 
platforms in the next patch series after I complete testing on all 
remaining platforms.

Regards,
Nitin

> 
>>
>> Signed-off-by: Nitin Rawat <quic_nitirawa@quicinc.com>
>> ---
>>   drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 19 +++++++++++++++----
>>   1 file changed, 15 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
>> index aaa88ca0ef07..1c3ce0fa6adf 100644
>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
>> @@ -1170,6 +1170,17 @@ static const struct regulator_bulk_data qmp_phy_vreg_l[] = {
>>   	{ .supply = "vdda-pll" },
>>   };
>>
>> +/* Regulator bulk data with load values for specific configurations */
>> +static const struct regulator_bulk_data sm8650_ufsphy_vreg_l[] = {
>> +	{ .supply = "vdda-phy", .init_load_uA = 205000 },
>> +	{ .supply = "vdda-pll", .init_load_uA = 17500 },
>> +};
>> +
>> +static const struct regulator_bulk_data sm8750_ufsphy_vreg_l[] = {
>> +	{ .supply = "vdda-phy", .init_load_uA = 213000 },
>> +	{ .supply = "vdda-pll", .init_load_uA = 18300 },
>> +};
>> +
>>   static const struct qmp_ufs_offsets qmp_ufs_offsets = {
>>   	.serdes		= 0,
>>   	.pcs		= 0xc00,
>> @@ -1638,8 +1649,8 @@ static const struct qmp_phy_cfg sm8650_ufsphy_cfg = {
>>   		.max_gear	= UFS_HS_G5,
>>   	},
>>
>> -	.vreg_list		= qmp_phy_vreg_l,
>> -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
>> +	.vreg_list		= sm8650_ufsphy_vreg_l,
>> +	.num_vregs		= ARRAY_SIZE(sm8650_ufsphy_vreg_l),
>>   	.regs			= ufsphy_v6_regs_layout,
>>   };
>>
>> @@ -1676,8 +1687,8 @@ static const struct qmp_phy_cfg sm8750_ufsphy_cfg = {
>>   		.max_gear	= UFS_HS_G5,
>>   	},
>>
>> -	.vreg_list		= qmp_phy_vreg_l,
>> -	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
>> +	.vreg_list		= sm8750_ufsphy_vreg_l,
>> +	.num_vregs		= ARRAY_SIZE(sm8750_ufsphy_vreg_l),
>>   	.regs			= ufsphy_v6_regs_layout,
>>
>>   };
>> --
>> 2.48.1
>>
>
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Dmitry Baryshkov 1 month, 2 weeks ago
On Wed, Aug 20, 2025 at 12:07:57PM +0530, Nitin Rawat wrote:
> 
> 
> On 8/20/2025 6:19 AM, Dmitry Baryshkov wrote:
> > On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
> > > Add regulator load voting support for SM8650 and SM8750 platforms by
> > > introducing dedicated regulator bulk data arrays with their load
> > > values.
> > > 
> > > The load requirements are:
> > > - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
> > > - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
> > > 
> > > This ensures stable operation and proper power management for these
> > > platforms where regulators are shared between the QMP USB PHY and
> > > other IP blocks by setting appropriate regulator load currents during PHY
> > > operations.
> > > 
> > > Configurations without specific load requirements will continue to work
> > > unchanged, as init_load_uA remains zero-initialized when .init_load_uA
> > > is not provided.
> > 
> > Can we please get configuration for the rest of the platforms?
> 
> Hi Dmitry,
> 
> If you're okay with it, can I merge the configuration for the remaining
> platforms in the next patch series after I complete testing on all remaining
> platforms.

You don't need to test, finding MSM8996 or 98 might be troublesome. Just
fill in the values from the hardware documentation.

-- 
With best wishes
Dmitry
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 1 week ago

On 8/20/2025 5:24 PM, Dmitry Baryshkov wrote:
> On Wed, Aug 20, 2025 at 12:07:57PM +0530, Nitin Rawat wrote:
>>
>>
>> On 8/20/2025 6:19 AM, Dmitry Baryshkov wrote:
>>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>>> introducing dedicated regulator bulk data arrays with their load
>>>> values.
>>>>
>>>> The load requirements are:
>>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>>
>>>> This ensures stable operation and proper power management for these
>>>> platforms where regulators are shared between the QMP USB PHY and
>>>> other IP blocks by setting appropriate regulator load currents during PHY
>>>> operations.
>>>>
>>>> Configurations without specific load requirements will continue to work
>>>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>>>> is not provided.
>>>
>>> Can we please get configuration for the rest of the platforms?
>>
>> Hi Dmitry,
>>
>> If you're okay with it, can I merge the configuration for the remaining
>> platforms in the next patch series after I complete testing on all remaining
>> platforms.
> 
> You don't need to test, finding MSM8996 or 98 might be troublesome. Just
> fill in the values from the hardware documentation.

Hi Dmitry,

While implementing changes for all remaining platform, I noticed that 
the "regulator-allow-set-load" property is defined only for SM8750 and 
SM8850 within the PMIC PHY and PLL device tree nodes which means that 
even if the UFS PHY driver is updated to vote for this configuration on 
other platforms, it will have no impact.

Should I still proceed with applying the change across all platform, or 
limit it to just the SM8750 and SM8850 drivers? What’s your recommendation?

===========================================================================
// Device tree:
vreg_l1j_0p91: ldo1 {
     regulator-name = "vreg_l1j_0p91";
     regulator-min-microvolt = <880000>;
     regulator-max-microvolt = <920000>;
     regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
     regulator-allow-set-load;
     regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM 
RPMH_REGULATOR_MODE_HPM>;
};

===========================================================================
drivers/regulator/of_regulator.c


if (of_property_read_bool(np, "regulator-allow-set-load"))
		constraints->valid_ops_mask |= REGULATOR_CHANGE_DRMS;

===========================================================================
//drivers/regulator/core.c
static int drms_uA_update(struct regulator_dev *rdev)
{
     ...
     if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_DRMS)) {
         rdev_dbg(rdev, "DRMS operation not allowed\n");
         return 0;
     }
     ...
}


Regards,
Nitin




> 

Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Dmitry Baryshkov 1 month, 1 week ago
On 21/08/2025 19:02, Nitin Rawat wrote:
> 
> 
> On 8/20/2025 5:24 PM, Dmitry Baryshkov wrote:
>> On Wed, Aug 20, 2025 at 12:07:57PM +0530, Nitin Rawat wrote:
>>>
>>>
>>> On 8/20/2025 6:19 AM, Dmitry Baryshkov wrote:
>>>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>>>> introducing dedicated regulator bulk data arrays with their load
>>>>> values.
>>>>>
>>>>> The load requirements are:
>>>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>>>
>>>>> This ensures stable operation and proper power management for these
>>>>> platforms where regulators are shared between the QMP USB PHY and
>>>>> other IP blocks by setting appropriate regulator load currents 
>>>>> during PHY
>>>>> operations.
>>>>>
>>>>> Configurations without specific load requirements will continue to 
>>>>> work
>>>>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>>>>> is not provided.
>>>>
>>>> Can we please get configuration for the rest of the platforms?
>>>
>>> Hi Dmitry,
>>>
>>> If you're okay with it, can I merge the configuration for the remaining
>>> platforms in the next patch series after I complete testing on all 
>>> remaining
>>> platforms.
>>
>> You don't need to test, finding MSM8996 or 98 might be troublesome. Just
>> fill in the values from the hardware documentation.
> 
> Hi Dmitry,
> 
> While implementing changes for all remaining platform, I noticed that 
> the "regulator-allow-set-load" property is defined only for SM8750 and 
> SM8850 within the PMIC PHY and PLL device tree nodes which means that 
> even if the UFS PHY driver is updated to vote for this configuration on 
> other platforms, it will have no impact.

If I remember correctly, on other platforms we don't allow setting the 
load exactly because consumers were not voting on the current/power 
requirements.

> 
> Should I still proceed with applying the change across all platform, or 
> limit it to just the SM8750 and SM8850 drivers? What’s your recommendation?

I think, we should proceed, then once all PHYs get those votes we can 
enable load toggling on those platforms too.

> 
> ===========================================================================
> // Device tree:
> vreg_l1j_0p91: ldo1 {
>      regulator-name = "vreg_l1j_0p91";
>      regulator-min-microvolt = <880000>;
>      regulator-max-microvolt = <920000>;
>      regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>      regulator-allow-set-load;
>      regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM 
> RPMH_REGULATOR_MODE_HPM>;
> };
> 
> ===========================================================================
> drivers/regulator/of_regulator.c
> 
> 
> if (of_property_read_bool(np, "regulator-allow-set-load"))
>          constraints->valid_ops_mask |= REGULATOR_CHANGE_DRMS;
> 
> ===========================================================================
> //drivers/regulator/core.c
> static int drms_uA_update(struct regulator_dev *rdev)
> {
>      ...
>      if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_DRMS)) {
>          rdev_dbg(rdev, "DRMS operation not allowed\n");
>          return 0;
>      }
>      ...
> }
> 
> 
> Regards,
> Nitin
> 
> 
> 
> 
>>
> 


-- 
With best wishes
Dmitry
Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 1 week ago

On 8/22/2025 2:49 PM, Dmitry Baryshkov wrote:
> On 21/08/2025 19:02, Nitin Rawat wrote:
>>
>>
>> On 8/20/2025 5:24 PM, Dmitry Baryshkov wrote:
>>> On Wed, Aug 20, 2025 at 12:07:57PM +0530, Nitin Rawat wrote:
>>>>
>>>>
>>>> On 8/20/2025 6:19 AM, Dmitry Baryshkov wrote:
>>>>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>>>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>>>>> introducing dedicated regulator bulk data arrays with their load
>>>>>> values.
>>>>>>
>>>>>> The load requirements are:
>>>>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>>>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>>>>
>>>>>> This ensures stable operation and proper power management for these
>>>>>> platforms where regulators are shared between the QMP USB PHY and
>>>>>> other IP blocks by setting appropriate regulator load currents 
>>>>>> during PHY
>>>>>> operations.
>>>>>>
>>>>>> Configurations without specific load requirements will continue to 
>>>>>> work
>>>>>> unchanged, as init_load_uA remains zero-initialized 
>>>>>> when .init_load_uA
>>>>>> is not provided.
>>>>>
>>>>> Can we please get configuration for the rest of the platforms?
>>>>
>>>> Hi Dmitry,
>>>>
>>>> If you're okay with it, can I merge the configuration for the remaining
>>>> platforms in the next patch series after I complete testing on all 
>>>> remaining
>>>> platforms.
>>>
>>> You don't need to test, finding MSM8996 or 98 might be troublesome. Just
>>> fill in the values from the hardware documentation.
>>
>> Hi Dmitry,
>>
>> While implementing changes for all remaining platform, I noticed that 
>> the "regulator-allow-set-load" property is defined only for SM8750 and 
>> SM8850 within the PMIC PHY and PLL device tree nodes which means that 
>> even if the UFS PHY driver is updated to vote for this configuration 
>> on other platforms, it will have no impact.
> 
> If I remember correctly, on other platforms we don't allow setting the 
> load exactly because consumers were not voting on the current/power 
> requirements.
> 
>>
>> Should I still proceed with applying the change across all platform, 
>> or limit it to just the SM8750 and SM8850 drivers? What’s your 
>> recommendation?
> 
> I think, we should proceed, then once all PHYs get those votes we can 
> enable load toggling on those platforms too.

Sure Dmitry. I'll make the change in next patchset.



> 
>>
>> ===========================================================================
>> // Device tree:
>> vreg_l1j_0p91: ldo1 {
>>      regulator-name = "vreg_l1j_0p91";
>>      regulator-min-microvolt = <880000>;
>>      regulator-max-microvolt = <920000>;
>>      regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>>      regulator-allow-set-load;
>>      regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM 
>> RPMH_REGULATOR_MODE_HPM>;
>> };
>>
>> ===========================================================================
>> drivers/regulator/of_regulator.c
>>
>>
>> if (of_property_read_bool(np, "regulator-allow-set-load"))
>>          constraints->valid_ops_mask |= REGULATOR_CHANGE_DRMS;
>>
>> ===========================================================================
>> //drivers/regulator/core.c
>> static int drms_uA_update(struct regulator_dev *rdev)
>> {
>>      ...
>>      if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_DRMS)) {
>>          rdev_dbg(rdev, "DRMS operation not allowed\n");
>>          return 0;
>>      }
>>      ...
>> }
>>
>>
>> Regards,
>> Nitin
>>
>>
>>
>>
>>>
>>
> 
> 

Re: [PATCH V3 2/2] phy: qcom-qmp-ufs: Add regulator loads for SM8650 and SM8750
Posted by Nitin Rawat 1 month, 1 week ago

On 8/21/2025 9:32 PM, Nitin Rawat wrote:
> 
> 
> On 8/20/2025 5:24 PM, Dmitry Baryshkov wrote:
>> On Wed, Aug 20, 2025 at 12:07:57PM +0530, Nitin Rawat wrote:
>>>
>>>
>>> On 8/20/2025 6:19 AM, Dmitry Baryshkov wrote:
>>>> On Wed, Aug 20, 2025 at 03:58:26AM +0530, Nitin Rawat wrote:
>>>>> Add regulator load voting support for SM8650 and SM8750 platforms by
>>>>> introducing dedicated regulator bulk data arrays with their load
>>>>> values.
>>>>>
>>>>> The load requirements are:
>>>>> - SM8650: vdda-phy (205mA), vdda-pll (17.5mA)
>>>>> - SM8750: vdda-phy (213mA), vdda-pll (18.3mA)
>>>>>
>>>>> This ensures stable operation and proper power management for these
>>>>> platforms where regulators are shared between the QMP USB PHY and
>>>>> other IP blocks by setting appropriate regulator load currents 
>>>>> during PHY
>>>>> operations.
>>>>>
>>>>> Configurations without specific load requirements will continue to 
>>>>> work
>>>>> unchanged, as init_load_uA remains zero-initialized when .init_load_uA
>>>>> is not provided.
>>>>
>>>> Can we please get configuration for the rest of the platforms?
>>>
>>> Hi Dmitry,
>>>
>>> If you're okay with it, can I merge the configuration for the remaining
>>> platforms in the next patch series after I complete testing on all 
>>> remaining
>>> platforms.
>>
>> You don't need to test, finding MSM8996 or 98 might be troublesome. Just
>> fill in the values from the hardware documentation.
> 
> Hi Dmitry,
> 
> While implementing changes for all remaining platform, I noticed that 
> the "regulator-allow-set-load" property is defined only for SM8750 and 
> SM8850 within the PMIC PHY and PLL device tree nodes which means that 
> even if the UFS PHY driver is updated to vote for this configuration on 
> other platforms, it will have no impact.
> 
> Should I still proceed with applying the change across all platform, or 
> limit it to just the SM8750 and *SM8850* drivers? What’s your recommendation?

Sorry for the typo. It's SM8650 and SM8750.

> 
> ===========================================================================
> // Device tree:
> vreg_l1j_0p91: ldo1 {
>      regulator-name = "vreg_l1j_0p91";
>      regulator-min-microvolt = <880000>;
>      regulator-max-microvolt = <920000>;
>      regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>      regulator-allow-set-load;
>      regulator-allowed-modes = <RPMH_REGULATOR_MODE_LPM 
> RPMH_REGULATOR_MODE_HPM>;
> };
> 
> ===========================================================================
> drivers/regulator/of_regulator.c
> 
> 
> if (of_property_read_bool(np, "regulator-allow-set-load"))
>          constraints->valid_ops_mask |= REGULATOR_CHANGE_DRMS;
> 
> ===========================================================================
> //drivers/regulator/core.c
> static int drms_uA_update(struct regulator_dev *rdev)
> {
>      ...
>      if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_DRMS)) {
>          rdev_dbg(rdev, "DRMS operation not allowed\n");
>          return 0;
>      }
>      ...
> }
> 
> 
> Regards,
> Nitin
> 
> 
> 
> 
>>
>