diff mbox series

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

Message ID 20240527-b4-qcom-capsule-updates-v2-3-47583d7ad428@linaro.org
State Superseded
Headers show
Series qcom: implement capsule updates | expand

Commit Message

Caleb Connolly May 27, 2024, 5:17 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.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
---
 drivers/mmc/msm_sdhci.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Neil Armstrong May 28, 2024, 8:04 a.m. UTC | #1
On 27/05/2024 19:17, Caleb Connolly wrote:
> 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.
> 
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
> ---
>   drivers/mmc/msm_sdhci.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> 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)
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
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)