Re: [PATCH v2 RESEND 2/6] mmc: rtsx_usb_sdmmc: start card power-up at 3.3V

From: Ulf Hansson

Date: Tue Mar 24 2026 - 07:48:08 EST


On Thu, 12 Mar 2026 at 13:16, Sean Rhodes <sean@starlabs.systems> wrote:
>
> Some tray-based readers keep SD_CD asserted even without a card. The
> rtsx_usb_sdmmc driver now validates insertion with a minimal probe
> sequence. That probe must start with the SD pads in 3.3V mode.
>
> Like the old rts5139 driver (sd_init_power()), force the SD pads to
> 3.3V and tune the SD18 regulator to 3.3V before powering up the card.
> This avoids spurious probe timeouts when the reader is left in 1.8V
> from a previous UHS session.
>
> Tested: Realtek RTS5129 (0bda:0129) + tray + Lexar 2TB SDXC
> Tested: cold boot detects mmcblk0 (2026-02-24)
> Tested: hotplug insert enumerates mmcblk0 (2026-02-23)
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>
> ---
> drivers/mmc/host/rtsx_usb_sdmmc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
> index ec3eeea78e95..6be98926387d 100644
> --- a/drivers/mmc/host/rtsx_usb_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
> @@ -1108,6 +1108,11 @@ static int sd_power_on(struct rtsx_usb_sdmmc *host)
> }
> dev_dbg(sdmmc_dev(host), "%s\n", __func__);
> rtsx_usb_init_cmd(ucr);
> + /* Start SD init at 3.3V, like the old rts5139 driver. */
> + rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, SD_PAD_CTL,
> + SD_IO_USING_1V8, SD_IO_USING_3V3);
> + rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, LDO_POWER_CFG,
> + TUNE_SD18_MASK, TUNE_SD18_3V3);

Ideally this should be managed by the ->start_signal_voltage_switch()
callback that is set to sdmmc_switch_voltage().

However, I understand that you may need this because of patch1, and
because mmc_power_up() first calls mmc_set_initial_state() before it
calls mmc_set_initial_signal_voltage().

Right?

> rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL);
> rtsx_usb_add_cmd(ucr, WRITE_REG_CMD, CARD_SHARE_MODE,
> CARD_SHARE_MASK, CARD_SHARE_SD);
> --
> 2.51.0

Kind regards
Uffe