From d9131bbe37a67de558460e1673e4e0441762dbcd Mon Sep 17 00:00:00 2001 From: Xuhui Lin Date: Fri, 4 Jul 2025 18:35:40 +0800 Subject: [PATCH] soc: rockchip: rockchip_thunderboot_mmc: Don't continue if timeout happens when loading firmware If mmc read timeout and continue start decom, the phenomenon is that decom error, and it's more difficult to locate the true reason. Change-Id: I95b2f2ac46764485bced6f86a715cfc5b7c80ef0 Signed-off-by: Xuhui Lin --- drivers/soc/rockchip/rockchip_thunderboot_mmc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/soc/rockchip/rockchip_thunderboot_mmc.c b/drivers/soc/rockchip/rockchip_thunderboot_mmc.c index 588677256a96..4c73ae4613fe 100644 --- a/drivers/soc/rockchip/rockchip_thunderboot_mmc.c +++ b/drivers/soc/rockchip/rockchip_thunderboot_mmc.c @@ -58,13 +58,17 @@ static int rk_tb_mmc_thread(void *p) if (readl_poll_timeout(regs + SDMMC_STATUS, status, !(status & (BIT(10) | GENMASK(7, 4))), 100, - 500 * USEC_PER_MSEC)) + 500 * USEC_PER_MSEC)) { dev_err(dev, "Controller is occupied!\n"); + goto out; + } if (readl_poll_timeout(regs + SDMMC_IDSTS, status, !(status & GENMASK(16, 13)), 100, - 500 * USEC_PER_MSEC)) + 500 * USEC_PER_MSEC)) { dev_err(dev, "DMA is still running!\n"); + goto out; + } status = readl_relaxed(regs + SDMMC_RINTSTS); if (status & SDMMC_INTR_ERROR) {