Skip to content

Commit e613cc4

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci: Fix sdhci_card_busy()
host->card_busy() was introduced for SD voltage switching which checks all 4 data lines. Increasingly, host->card_busy is being used to poll the the busy signal which is only data line 0 (DAT[0]). The current logic in sdhci_card_busy() does not work in that case because it returns false if any of the data lines is high. It also ignores possibilities: - data lines 1-3 are not connected and could show at any level - data lines 1-2 can be used by SDIO for other purposes According to the SD specification, it is OK to check any of the data lines for voltage switching, so change to use DAT[0] only. Signed-off-by: Adrian Hunter <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 7c42dbf commit e613cc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/mmc/host/sdhci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,10 +1811,10 @@ static int sdhci_card_busy(struct mmc_host *mmc)
18111811
struct sdhci_host *host = mmc_priv(mmc);
18121812
u32 present_state;
18131813

1814-
/* Check whether DAT[3:0] is 0000 */
1814+
/* Check whether DAT[0] is 0 */
18151815
present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
18161816

1817-
return !(present_state & SDHCI_DATA_LVL_MASK);
1817+
return !(present_state & SDHCI_DATA_0_LVL_MASK);
18181818
}
18191819

18201820
static int sdhci_prepare_hs400_tuning(struct mmc_host *mmc, struct mmc_ios *ios)

0 commit comments

Comments
 (0)