[PATCH master 2/3] mci: core: fix fallback when host doesn't support HS200

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Apr 22 23:22:05 PDT 2024


If switching the card into HS200 mode via mmc_select_timing() succeeds,
but switching the host fails in mmc_hs200_tuning(), we are left with
wrong timing information, which prevents us from falling back to a lower
speed mode. Restore the high speed timing on failure to resolve this.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/mci/mci-core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 57b4c5b99c9c..af0980308866 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1551,6 +1551,11 @@ static int mci_startup_mmc(struct mci *mci)
 
 		if (mmc_card_hs200(mci))
 			ret = mmc_hs200_tuning(mci);
+
+		if (ret) {
+			host->timing = MMC_TIMING_MMC_HS;
+			mci_switch(mci, EXT_CSD_HS_TIMING, EXT_CSD_TIMING_HS);
+		}
 	}
 
 	if (ret || !IS_ENABLED(CONFIG_MCI_TUNING)) {
-- 
2.39.2




More information about the barebox mailing list