diff mbox series

[v3,3/8] mmc: msm_sdhci: work around a bug when writing

Message ID 20240603-b4-qcom-capsule-updates-v3-3-fe2e083289ec@linaro.org
State New
Headers show
Series qcom: implement capsule updates | expand

Commit Message

Caleb Connolly June 3, 2024, 12:49 p.m. UTC
For some unknown reason, writes of larger than 1 block always fail with
a checksum error on Qualcomm v5 controllers.

Until this is resolved, work around the issue by setting b_max to 1 for
these controllers.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 drivers/mmc/msm_sdhci.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
index 4ce0de6c47d8..fc3e8d101b6e 100644
--- a/drivers/mmc/msm_sdhci.c
+++ b/drivers/mmc/msm_sdhci.c
@@ -195,8 +195,15 @@  static int msm_sdc_probe(struct udevice *dev)
 		return ret;
 	host->mmc->priv = &prv->host;
 	upriv->mmc = host->mmc;
 
+	/*
+	 * FIXME: v5 controllers have a bug in U-Boot that causes all writes
+	 * greater than 1 block to fail. Work around this by setting b_max to 1.
+	 */
+	if (var_info->mci_removed)
+		plat->cfg.b_max = 1;
+
 	return sdhci_probe(dev);
 }
 
 static int msm_sdc_remove(struct udevice *dev)