]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
mmc: mtk-sd: fix msdc cmd ready check
authorht.lin <ht.lin@mediatek.com>
Tue, 21 Apr 2026 14:24:06 +0000 (09:24 -0500)
committerDavid Lechner <dlechner@baylibre.com>
Tue, 28 Apr 2026 15:45:07 +0000 (10:45 -0500)
Correct the check condition in msdc_cmd_is_ready() for MSDC_PS_DAT0
polling. Without this change, it may not be able to detect if the SD
controller is busy correctly for issuing the command.

Fixes: d24b69395949 ("mmc: mtk-sd: add SD/MMC host controller driver for MT7623 SoC")
Signed-off-by: ht.lin <ht.lin@mediatek.com>
Reviewed-by: Julien Stephan <jstephan@baylibre.com>
Tested-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260421-mmc-mtk-sd-fixes-v1-3-5b840c546af2@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
drivers/mmc/mtk-sd.c

index 616cf3f360f3e56ae9a9101ae00cac896ece5c2f..51c9c0a3fad9b3c7930f4994704efa7a27e35712 100644 (file)
@@ -539,7 +539,7 @@ static bool msdc_cmd_is_ready(struct msdc_host *host)
                return false;
        }
 
-       if (host->last_resp_type == MMC_RSP_R1b && host->last_data_write) {
+       if (host->last_resp_type == MMC_RSP_R1b || host->last_data_write) {
                ret = readl_poll_timeout(&host->base->msdc_ps, reg,
                                         reg & MSDC_PS_DAT0, 1000000);