mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands
@ 2020-05-11 16:49 Lucas Stach
  2020-05-11 16:49 ` [PATCH 2/2] mci: stm32_sdmmc2: move command timeout errors to debug level Lucas Stach
  2020-05-12  7:47 ` [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Lucas Stach @ 2020-05-11 16:49 UTC (permalink / raw)
  To: barebox

No other MCI does retry failing commands on its own (if at all
this should be done by the MCI core). Remove the retry, as we
don't want to paper over board level issues.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/mci/stm32_sdmmc2.c | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
index 0c26869b0378..de96f0974489 100644
--- a/drivers/mci/stm32_sdmmc2.c
+++ b/drivers/mci/stm32_sdmmc2.c
@@ -481,11 +481,8 @@ static int stm32_sdmmc2_send_cmd(struct mci_host *mci, struct mci_cmd *cmd,
 {
 	struct stm32_sdmmc2_priv *priv = to_mci_host(mci);
 	u32 cmdat = data ? SDMMC_CMD_CMDTRANS : 0;
-	u32 data_length;
-	int ret, retry = 3;
-
-retry_cmd:
-	data_length = 0;
+	u32 data_length = 0;
+	int ret;
 
 	if (data) {
 		data_length = data->blocks * data->blocksize;
@@ -530,15 +527,6 @@ retry_cmd:
 		writel(SDMMC_ICR_STATIC_FLAGS, priv->base + SDMMC_ICR);
 	}
 
-	if (ret && retry) {
-		dev_warn(priv->dev, "%s: cmd %d failed, retrying ...\n",
-			 __func__, cmd->cmdidx);
-
-		retry--;
-
-		goto retry_cmd;
-	}
-
 	dev_dbg(priv->dev, "%s: end for CMD %d, ret = %d\n", __func__,
 		cmd->cmdidx, ret);
 
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* [PATCH 2/2] mci: stm32_sdmmc2: move command timeout errors to debug level
  2020-05-11 16:49 [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands Lucas Stach
@ 2020-05-11 16:49 ` Lucas Stach
  2020-05-12  7:47 ` [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Lucas Stach @ 2020-05-11 16:49 UTC (permalink / raw)
  To: barebox

Command timeouts are sometimes a normal operating condition
(for example when probing whether the connected card is SD or MMC),
so we don't want to print an error message for all of them. Move
those messages to the debug level, the MCI core will print some
more meaningful messages on most command errors anyways.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/mci/stm32_sdmmc2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
index de96f0974489..3ce3bb0f89d2 100644
--- a/drivers/mci/stm32_sdmmc2.c
+++ b/drivers/mci/stm32_sdmmc2.c
@@ -367,7 +367,7 @@ static int stm32_sdmmc2_end_cmd(struct stm32_sdmmc2_priv *priv,
 
 	/* Check status */
 	if (status & SDMMC_STA_CTIMEOUT) {
-		dev_err(priv->dev, "%s: error SDMMC_STA_CTIMEOUT (0x%x) for cmd %d\n",
+		dev_dbg(priv->dev, "%s: error SDMMC_STA_CTIMEOUT (0x%x) for cmd %d\n",
 			__func__, status, cmd->cmdidx);
 		return -ETIMEDOUT;
 	}
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands
  2020-05-11 16:49 [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands Lucas Stach
  2020-05-11 16:49 ` [PATCH 2/2] mci: stm32_sdmmc2: move command timeout errors to debug level Lucas Stach
@ 2020-05-12  7:47 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2020-05-12  7:47 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon, May 11, 2020 at 06:49:56PM +0200, Lucas Stach wrote:
> No other MCI does retry failing commands on its own (if at all
> this should be done by the MCI core). Remove the retry, as we
> don't want to paper over board level issues.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/mci/stm32_sdmmc2.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/mci/stm32_sdmmc2.c b/drivers/mci/stm32_sdmmc2.c
> index 0c26869b0378..de96f0974489 100644
> --- a/drivers/mci/stm32_sdmmc2.c
> +++ b/drivers/mci/stm32_sdmmc2.c
> @@ -481,11 +481,8 @@ static int stm32_sdmmc2_send_cmd(struct mci_host *mci, struct mci_cmd *cmd,
>  {
>  	struct stm32_sdmmc2_priv *priv = to_mci_host(mci);
>  	u32 cmdat = data ? SDMMC_CMD_CMDTRANS : 0;
> -	u32 data_length;
> -	int ret, retry = 3;
> -
> -retry_cmd:
> -	data_length = 0;
> +	u32 data_length = 0;
> +	int ret;
>  
>  	if (data) {
>  		data_length = data->blocks * data->blocksize;
> @@ -530,15 +527,6 @@ retry_cmd:
>  		writel(SDMMC_ICR_STATIC_FLAGS, priv->base + SDMMC_ICR);
>  	}
>  
> -	if (ret && retry) {
> -		dev_warn(priv->dev, "%s: cmd %d failed, retrying ...\n",
> -			 __func__, cmd->cmdidx);
> -
> -		retry--;
> -
> -		goto retry_cmd;
> -	}
> -
>  	dev_dbg(priv->dev, "%s: end for CMD %d, ret = %d\n", __func__,
>  		cmd->cmdidx, ret);
>  
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2020-05-12  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11 16:49 [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands Lucas Stach
2020-05-11 16:49 ` [PATCH 2/2] mci: stm32_sdmmc2: move command timeout errors to debug level Lucas Stach
2020-05-12  7:47 ` [PATCH 1/2] mci: stm32_sdmmc2: don't retry commands Sascha Hauer

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