Patchwork [U-Boot,v2,5/5] Fix timeout in Marvell SDIO MMC driver

login
register
mail settings
Submitter DrEagle
Date Sept. 22, 2012, 7:18 a.m.
Message ID <505D6656.5040108@doukki.net>
Download mbox | patch
Permalink /patch/186105/
State Changes Requested
Delegated to: Prafulla Wadaskar
Headers show

Comments

DrEagle - Sept. 22, 2012, 7:18 a.m.
Fix an issue with most SDHC cards because of timeout delay

Signed-off-by: drEagle <dreagle@doukki.net>
---
 drivers/mmc/mrvl_mmc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Prafulla Wadaskar - Sept. 24, 2012, 8:44 a.m.
> -----Original Message-----
> From: u-boot-bounces@lists.denx.de [mailto:u-boot-
> bounces@lists.denx.de] On Behalf Of DrEagle
> Sent: 22 September 2012 12:49
> To: DrEagle
> Cc: Lior Amsalem; u-boot@lists.denx.de; uboot@doukki.net
> Subject: [U-Boot] [PATCH v2 5/5] Fix timeout in Marvell SDIO MMC
> driver
> 
> 
> Fix an issue with most SDHC cards because of timeout delay
> 
> Signed-off-by: drEagle <dreagle@doukki.net>
> ---
>  drivers/mmc/mrvl_mmc.c |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Well, you can make this as a part of your first patch since you are creating these files

Regards...
Prafulla . . .

Patch

diff --git a/drivers/mmc/mrvl_mmc.c b/drivers/mmc/mrvl_mmc.c
index 8127961..bdafbc7 100644
--- a/drivers/mmc/mrvl_mmc.c
+++ b/drivers/mmc/mrvl_mmc.c
@@ -4,6 +4,7 @@ 
  * (C) Copyright 2012
  * Marvell Semiconductor <www.marvell.com>
  * Written-by: Lior Amsalem <alior@marvell.com>
+ * Written-by: GĂ©rald Kerma <uboot@doukki.net>
  * See file CREDITS for list of people who contributed to this
  * project.
  *
@@ -127,10 +128,9 @@  static int mrvl_mmc_send_cmd (struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_d
 	SDIO_REG_WRITE16(SDIO_CMD, MRVL_MMC_MAKE_CMD(cmd->cmdidx, resptype));
 
 	/* Waiting for completion */
-	timeout = 1000000;
+	timeout = 10000;
 
 	while (!((SDIO_REG_READ16(SDIO_NOR_INTR_STATUS)) & waittype)) {
-		udelay(1);
 		if (SDIO_REG_READ16(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) {
 #ifdef DEBUG
 			printf("mrvl_mmc_send_cmd: error! cmd : %d, err reg: %04x\n", cmd->cmdidx, SDIO_REG_READ16(SDIO_ERR_INTR_STATUS));
@@ -139,6 +139,7 @@  static int mrvl_mmc_send_cmd (struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_d
 				return TIMEOUT;
 			return COMM_ERR;
 		}
+		udelay(1000);
 		timeout--;
 		if (timeout <= 0) {
 			printf("MRVL MMC: command timed out\n");