All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: SignKirigami <prcups@krgm.moe>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/2] regulator: qcom-rpmh: Add PM6450 LDO support
Date: Tue, 24 Nov 2026 11:03:37 +0000	[thread overview]
Message-ID: <sashiko-outbox-231015@kernel.org> (raw)
In-Reply-To: <20261124-netrani-pm6450-v1-v1-2-1914da758d3d@krgm.moe>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] regulator: qcom-rpmh: ldo24 n_voltages=0 breaks UFS load voting
  and DT uV
--

commit 9fd0e1480b4f40cc51922b0274d428fec8c1448a
Author: SignKirigami <prcups@krgm.moe>

regulator: qcom-rpmh: Add PM6450 LDO support

This commit adds RPMh regulator definitions for the PM6450 PMIC LDOs,
using a no-voltage VRM configuration for LDO24 to preserve its power-on
voltage.

> diff --git a/drivers/regulator/qcom-rpmh-regulator.c b/drivers/regulator/qcom-rpmh-regulator.c
> index da4764ffa6325..c397717dc0d6d 100644
> --- a/drivers/regulator/qcom-rpmh-regulator.c
> +++ b/drivers/regulator/qcom-rpmh-regulator.c
> @@ -475,6 +475,15 @@ static const struct regulator_ops rpmh_regulator_vrm_bypass_ops = {
>  	.get_bypass		= rpmh_regulator_vrm_get_bypass,
>  };
>  
> +static const struct regulator_ops rpmh_regulator_vrm_no_voltage_ops = {
> +	.enable			= rpmh_regulator_enable,
> +	.disable		= rpmh_regulator_disable,
> +	.is_enabled		= rpmh_regulator_is_enabled,
> +	.set_mode		= rpmh_regulator_vrm_set_mode,
> +	.get_mode		= rpmh_regulator_vrm_get_mode,
> +	.get_optimum_mode	= rpmh_regulator_vrm_get_optimum_mode,
> +};
> +
>  static const struct regulator_ops rpmh_regulator_xob_ops = {
>  	.enable			= rpmh_regulator_enable,
>  	.disable		= rpmh_regulator_disable,
> @@ -1588,6 +1597,31 @@ static const struct rpmh_vreg_init_data pm6150l_vreg_data[] = {
>  	{}
>  };
>  
> +static const struct rpmh_vreg_hw_data pm6450_ldo_10ma_no_voltage = {
> +	.regulator_type = VRM,
> +	.ops = &rpmh_regulator_vrm_no_voltage_ops,
> +	.hpm_min_load_uA = 10000,
> +	.pmic_mode_map = pmic_mode_map_pmic5_ldo,
> +	.of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode,
> +};
> +
> +static const struct rpmh_vreg_init_data pm6450_vreg_data[] = {
> +	RPMH_VREG("ldo5", LDO, 5, &pmic5_nldo, NULL),
> +	RPMH_VREG("ldo7", LDO, 7, &pmic5_nldo, NULL),
> +	RPMH_VREG("ldo13", LDO, 13, &pmic5_nldo, NULL),
> +	RPMH_VREG("ldo16", LDO, 16, &pmic5_nldo, NULL),
> +	RPMH_VREG("ldo19", LDO, 19, &pmic5_pldo, NULL),
> +	RPMH_VREG("ldo23", LDO, 23, &pmic5_pldo, NULL),
> +	/*
> +	 * UFS VCC is selected at power-on (2.4 V or 2.96 V) according to
> +	 * the storage configuration. Preserve that selection and only vote
> +	 * enable and mode.
> +	 */
> +	RPMH_VREG("ldo24", LDO, 24, &pm6450_ldo_10ma_no_voltage, NULL),

[Severity: High]
Does leaving n_voltages unset on pm6450_ldo_10ma_no_voltage break UFS VCC
load-based mode switching and regulator registration when DT voltage
constraints are present?

pm6450_ldo_10ma_no_voltage sets hpm_min_load_uA and get_optimum_mode for
UFS load voting, but because n_voltages is 0, regulator_count_voltages()
returns -EINVAL and ufshcd_config_vreg() skips regulator_set_load():

drivers/ufs/core/ufshcd.c:ufshcd_config_vreg() {
	...
	if (regulator_count_voltages(vreg->reg) <= 0)
		return 0;

	return ufshcd_config_vreg_load(dev, vreg, on ? vreg->max_uA : 0);
}

In addition, rpmh_regulator_init_vreg() only populates rdesc.fixed_uV and
rdesc.n_voltages = 1 from DT constraints when regulator_type is XOB.  If a
DT node for ldo24 specifies regulator-min-microvolt and
regulator-max-microvolt, machine_constraints_voltage() calls
regulator_get_voltage_rdev(), which returns -EINVAL because
rpmh_regulator_vrm_no_voltage_ops has no voltage callbacks and fixed_uV is
0, failing rpmh_regulator_probe().

Using pmic5_pldo for ldo24 avoids both issues while still preserving the
power-on voltage read back by _rpmh_regulator_vrm_get_voltage() when the
DT node either omits microvolt constraints or specifies a range covering
2.4 V to 2.96 V.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-netrani-pm6450-v1-v1-0-1914da758d3d@krgm.moe?part=2

      reply	other threads:[~2026-11-24 11:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 10:43 [PATCH 0/2] Add PM6450 RPMh regulator support SignKirigami
2026-11-24 10:44 ` [PATCH 1/2] dt-bindings: regulator: qcom,rpmh: Add PM6450 SignKirigami
2026-11-24 10:44 ` [PATCH 2/2] regulator: qcom-rpmh: Add PM6450 LDO support SignKirigami
2026-11-24 11:03   ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-231015@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=prcups@krgm.moe \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.