From: Adrian Hunter <adrian.hunter@intel.com>
To: Shawn Lin <shawn.lin@rock-chips.com>, Ulf Hansson <ulfh@kernel.org>
Cc: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] mmc: core: Use the ios vdd when calculating vqmmc for 3.3V signaling
Date: Tue, 6 Oct 2026 08:58:39 +0300 [thread overview]
Message-ID: <79fca026-b992-4490-acc3-845f2a3a5e6f@intel.com> (raw)
In-Reply-To: <1790742751-245571-3-git-send-email-shawn.lin@rock-chips.com>
On 30/09/2026 07:32, Shawn Lin wrote:
> mmc_regulator_set_vqmmc() takes an ios pointer and switches on its
> signal_voltage, but the MMC_SIGNAL_VOLTAGE_330 path looks up the VMMC
> voltage range using mmc->ios.vdd instead of ios->vdd. That mixes the
> ios passed by the caller with the global mmc->ios state, which do not
> have to agree.
>
> mmc_set_signal_voltage() only updates host->ios.signal_voltage before
> invoking ->start_signal_voltage_switch(); host->ios.vdd is refreshed
> when the power supply is (re)configured, e.g. in mmc_power_up() after a
> new OCR has been selected. A host driver switching the signal voltage
> for a vdd that has not been committed to mmc->ios yet, or passing its
> own ios snapshot, would therefore get a vqmmc range computed for the
> previous, stale vdd instead of the signaling voltage it is switching
> to. With a stale vdd of the 1.65-1.95V range, the computed 3.3V window
> ends up with min_uV > max_uV and the vqmmc regulator is never set, so
> the signaling switch fails.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
>
> ---
>
> drivers/mmc/core/regulator.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/regulator.c b/drivers/mmc/core/regulator.c
> index a85179f..c553356 100644
> --- a/drivers/mmc/core/regulator.c
> +++ b/drivers/mmc/core/regulator.c
> @@ -197,7 +197,7 @@ int mmc_regulator_set_vqmmc(struct mmc_host *mmc, struct mmc_ios *ios)
> return mmc_regulator_set_voltage_if_supported(mmc->supply.vqmmc,
> 1700000, 1800000, 1950000);
> case MMC_SIGNAL_VOLTAGE_330:
> - ret = mmc_ocrbitnum_to_vdd(mmc->ios.vdd, &volt, &max_uV);
> + ret = mmc_ocrbitnum_to_vdd(ios->vdd, &volt, &max_uV);
> if (ret < 0)
> return ret;
>
next prev parent reply other threads:[~2026-10-06 5:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-30 4:32 [PATCH 0/2] Let mmc_regulator_set_vqmmc() use ios->vdd to set vqmmc Shawn Lin
2026-09-30 4:32 ` [PATCH 1/2] mmc: sdhci-msm: Initialize the local ios in msm_toggle_vqmmc() Shawn Lin
2026-10-06 5:58 ` Adrian Hunter
2026-09-30 4:32 ` [PATCH 2/2] mmc: core: Use the ios vdd when calculating vqmmc for 3.3V signaling Shawn Lin
2026-10-06 5:58 ` Adrian Hunter [this message]
2026-09-30 9:40 ` [PATCH 0/2] Let mmc_regulator_set_vqmmc() use ios->vdd to set vqmmc Ulf Hansson
2026-09-30 14:46 ` Shawn Lin
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=79fca026-b992-4490-acc3-845f2a3a5e6f@intel.com \
--to=adrian.hunter@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulfh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®