From: kfx Date: Thu, 2 Sep 2010 04:28:42 +0000 (+0800) Subject: fix 'sdio_probe return error when host controller's status is data_busy. data_busy... X-Git-Tag: firefly_0821_release~11200 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=38ec7ee48e843696a812b3dff26b7913747076a0;p=firefly-linux-kernel-4.4.55.git fix 'sdio_probe return error when host controller's status is data_busy. data_busy occurs when wifi module is NOT inserted.' --- diff --git a/drivers/mmc/host/rk2818-sdmmc.c b/drivers/mmc/host/rk2818-sdmmc.c index 6cd5b6f22295..726c778bfa3e 100755 --- a/drivers/mmc/host/rk2818-sdmmc.c +++ b/drivers/mmc/host/rk2818-sdmmc.c @@ -1893,6 +1893,13 @@ static int rk2818_sdmmc_probe(struct platform_device *pdev) writel(SDMMC_INT_CMD_DONE | SDMMC_INT_DTO | RK2818_MCI_ERROR_FLAGS | SDMMC_INT_CD, host->regs + SDMMC_INTMASK); + if((strncmp(host->dma_name, "sdio", strlen("sdio")) == 0) && + (readl(host->regs + SDMMC_STATUS) & SDMMC_STAUTS_DATA_BUSY)) + { + dev_err(host->dev, "sdio is busy, fail to init sdio.please check if wifi_d0's level is high?\n"); + ret = -EINVAL; + return ret; + } #if 0 /* Assume card is present initially */ if(rk2818_sdmmc_get_cd(host->mmc) == 0 &&strncmp(host->dma_name, "sdio", strlen("sdio")) == 0) @@ -1938,7 +1945,7 @@ static int rk2818_sdmmc_probe(struct platform_device *pdev) #endif writel(SDMMC_CTRL_INT_ENABLE, host->regs + SDMMC_CTRL); // enable mci interrupt - dev_dbg(&pdev->dev, "RK2818 MMC controller used as %s, at irq %d\n", + dev_info(&pdev->dev, "RK2818 MMC controller used as %s, at irq %d\n", host->dma_name, host->irq); return 0; err_remove_host: