From 8a53211a415d795ee65be9e8a35629d9697bb28c Mon Sep 17 00:00:00 2001 From: Sarthak Garg Date: Fri, 4 Sep 2020 12:49:06 +0530 Subject: [PATCH] mmc: sdhci-msm: Add the missing check in sdhci_msm_check_power_status On multi-card tray designs, the same card-tray would be used for SD card and SIM cards. If SD card is placed at the rightmost location in the tray, then SIM card may come in contact with SD card power- supply while removing the tray. It may result in SIM damage. So in sdhci_msm_handle_pwr_irq we skip the BUS_ON request when the SD card is removed to be in consistent with the MGPI hardware fix to prevent any damage to the SIM card in case of mult-card tray designs. But we need to have a similar check in sdhci_msm_check_power_status to be in consistent with the sdhci_msm_handle_pwr_irq function. Change-Id: Ia3248139f351fa80dde163f805fa072cb298f39b Signed-off-by: Sarthak Garg --- drivers/mmc/host/sdhci-msm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index c972e64e90d9..c81eef68dfe7 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -1751,8 +1751,10 @@ static void sdhci_msm_check_power_status(struct sdhci_host *host, u32 req_type) return; } - if (mmc->ops->get_cd && !mmc->ops->get_cd(mmc)) { - pr_debug("%s: card is not present. Do not wait for pwr irq\n", + if (mmc->card && mmc->ops->get_cd && !mmc->ops->get_cd(mmc) && + (req_type & REQ_BUS_ON)) { + pr_debug( + "%s: Regulators are never turned on when SD card is removed so do not wait for pwr irq\n", mmc_hostname(host->mmc)); return; }