Re: [PATCH 1/2] mmc: sdhci-msm: Initialize the local ios in msm_toggle_vqmmc()
From: Adrian Hunter
Date: Tue Oct 06 2026 - 01:58:34 EST
On 30/09/2026 07:32, Shawn Lin wrote:
> 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@xxxxxxxxxxxxxxx
> Signed-off-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx>
Acked-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> ---
>
> 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;