Re: [PATCH] mmc: rtsx_usb_sdmmc: allow legacy SD init after CMD8 timeout

From: Ulf Hansson

Date: Mon Nov 30 2026 - 11:16:07 EST


On Fri, Nov 20, 2026 at 4:52 PM Sean Rhodes <sean@starlabs.systems> wrote:
>
> According to the rts5139 staging driver, SD 1.x cards do not respond
> to SD_SEND_IF_COND. On an RTS5129, a preinserted 2 GB SD card times
> out on that command and the driver then rejects CMD55 and subsequent
> initialization requests with -ENOMEDIUM. This prevents MMC core from
> trying the legacy SD path.
>
> Do not suppress card detection on a timeout from a no-data CMD8.
> MMC SEND_EXT_CSD uses the same opcode with a data transfer, so retain
> the existing timeout handling for that command. Keep refreshing the
> physical card state and retain suppression on other discovery timeouts
> to stop repeated probes of an empty tray.
>
> Fixes: 7185b6d33b17 ("mmc: rtsx_usb_sdmmc: suppress false CD after init timeout")
> Reported-by: Philipp Jonas <pjjonas@xxxxxx>
> Closes: https://lore.kernel.org/r/523eb7d1cc0811df4a5e4c534538f3dd@xxxxxx
> Tested-by: Philipp Jonas <pjjonas@xxxxxx>
> Signed-off-by: Sean Rhodes <sean@starlabs.systems>

Applied fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/host/rtsx_usb_sdmmc.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c
> index bf37fab233cf..55fb83f29328 100644
> --- a/drivers/mmc/host/rtsx_usb_sdmmc.c
> +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c
> @@ -879,10 +879,12 @@ static void sdmmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
> finish_detect_card:
> if (cmd->error) {
> /*
> - * detect card when fail to update card existence state and
> - * speed up card removal when retry
> + * SD 1.x cards can time out on SEND_IF_COND. Leave card
> + * detection enabled for the legacy initialization sequence.
> + * MMC SEND_EXT_CSD shares the opcode but carries data.
> */
> - if (!mmc->card && cmd->error == -ETIMEDOUT)
> + if (!mmc->card && cmd->error == -ETIMEDOUT &&
> + (cmd->opcode != SD_SEND_IF_COND || data))
> WRITE_ONCE(host->suppress_cd, true);
> sdmmc_get_cd(mmc);
> dev_dbg(sdmmc_dev(host), "cmd->error = %d\n", cmd->error);
> --
> 2.53.0
>