mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH master 1/3] mci: core: fix fallback when eMMC DDR52 is not possible
@ 2024-04-23  6:22 Ahmad Fatoum
  2024-04-23  6:22 ` [PATCH master 2/3] mci: core: fix fallback when host doesn't support HS200 Ahmad Fatoum
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ahmad Fatoum @ 2024-04-23  6:22 UTC (permalink / raw)
  To: barebox; +Cc: str, mtr, Ahmad Fatoum

mci_mmc_select_hs_ddr() will try DDR52 and if that fails, revert to
SDR operation. In that case, it returns the bus width, which would
be forwarded as if it were an error code:

  WARNING: mmc2: Card's startup fails with 3

Fix this by translating successful return values to 0 in
mci_startup_mmc().

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mci/mci-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index 1d383e6449e9..57b4c5b99c9c 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1566,7 +1566,7 @@ static int mci_startup_mmc(struct mci *mci)
 		}
 	}
 
-	return ret;
+	return ret >= MMC_BUS_WIDTH_1 ? 0 : ret;
 }
 
 /**
-- 
2.39.2




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-04-30  5:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23  6:22 [PATCH master 1/3] mci: core: fix fallback when eMMC DDR52 is not possible Ahmad Fatoum
2024-04-23  6:22 ` [PATCH master 2/3] mci: core: fix fallback when host doesn't support HS200 Ahmad Fatoum
2024-04-23  6:22 ` [PATCH master 3/3] mci: core: make execute_tuning mandatory for HS200 Ahmad Fatoum
2024-04-23  6:44 ` [PATCH master 1/3] mci: core: fix fallback when eMMC DDR52 is not possible Sascha Hauer
2024-04-23  6:52   ` Ahmad Fatoum
2024-04-30  5:44 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox