]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: sdhci: Start status timeout after command issue
authorTanmay Kathpalia <tanmay.kathpalia@gmail.com>
Sat, 9 May 2026 17:59:32 +0000 (23:29 +0530)
committerPeng Fan <peng.fan@nxp.com>
Fri, 15 May 2026 03:44:58 +0000 (11:44 +0800)
The status polling timeout in sdhci_send_command() should measure the
time spent waiting for the command interrupt after the command has been
issued.

Do not initialize the timer at function entry, since the command inhibit
wait and setup path can consume time before SDHCI_COMMAND is written.
Start the timer immediately after issuing the command instead.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/mmc/sdhci.c

index 648dfa4b5efb712e01793fb26e1eb2361a07bfc8..08594e10266934e90c7c10388b4adc60b54fe14c 100644 (file)
@@ -215,7 +215,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
        u32 mask, flags, mode = 0;
        unsigned int time = 0;
        int mmc_dev = mmc_get_blk_desc(mmc)->devnum;
-       ulong start = get_timer(0);
+       ulong start;
 
        host->start_addr = 0;
        /* Timeout unit - ms */