mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Ulf Hansson <ulfh@kernel.org>
Cc: linux-mmc@vger.kernel.org,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-kernel@vger.kernel.org,
	Shawn Lin <shawn.lin@rock-chips.com>,
	linux-arm-msm@vger.kernel.org
Subject: [PATCH 1/2] mmc: sdhci-msm: Initialize the local ios in msm_toggle_vqmmc()
Date: Wed, 30 Sep 2026 12:32:30 +0800	[thread overview]
Message-ID: <1790742751-245571-2-git-send-email-shawn.lin@rock-chips.com> (raw)
In-Reply-To: <1790742751-245571-1-git-send-email-shawn.lin@rock-chips.com>

msm_toggle_vqmmc() builds a local struct mmc_ios and only initializes
its signal_voltage, leaving vdd and the other members uninitialized
when passing it to mmc_regulator_set_vqmmc(). It happens to work
because the function only looks at signal_voltage today, but the next
patch makes mmc_regulator_set_vqmmc() honor ios->vdd when calculating
the 3.3V voltage range, which would read the uninitialized member.

Start the local ios from mmc->ios so that all members are valid.

Cc: linux-arm-msm@vger.kernel.org
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
---

 drivers/mmc/host/sdhci-msm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index aecd425..32b1bcb 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -1490,7 +1490,7 @@ static int msm_toggle_vqmmc(struct sdhci_msm_host *msm_host,
 			      struct mmc_host *mmc, bool level)
 {
 	int ret;
-	struct mmc_ios ios;
+	struct mmc_ios ios = mmc->ios;
 
 	if (msm_host->vqmmc_enabled == level)
 		return 0;
-- 
2.7.4


  reply	other threads:[~2026-09-30 11:22 UTC|newest]

Thread overview: 5+ 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 ` Shawn Lin [this message]
2026-09-30  4:32 ` [PATCH 2/2] mmc: core: Use the ios vdd when calculating vqmmc for 3.3V signaling Shawn Lin
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=1790742751-245571-2-git-send-email-shawn.lin@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --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®