public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: DrEagle <dreagle@doukki.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 5/5] Fix timeout in Marvell SDIO MMC driver
Date: Sat, 22 Sep 2012 09:18:46 +0200	[thread overview]
Message-ID: <505D6656.5040108@doukki.net> (raw)
In-Reply-To: <505C3E5D.8000305@doukki.net>


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(-)

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");
-- 
1.7.10.4

  parent reply	other threads:[~2012-09-22  7:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-21 10:15 [U-Boot] [PATCH 0/4] Marvell SDIO/MMC driver for Sheevaplug DrEagle
2012-09-22  7:15 ` [U-Boot] [PATCH v2 0/5] " DrEagle
2012-09-22  7:34   ` DrEagle
2012-09-24  8:50     ` Prafulla Wadaskar
2012-09-24  7:36   ` Prafulla Wadaskar
2012-09-24  8:48   ` Prafulla Wadaskar
2012-09-22  7:15 ` [U-Boot] [PATCH v2 1/5] Add Marvell SDIO/MMC driver for Kirkwood SoC DrEagle
2012-09-24  8:42   ` Prafulla Wadaskar
2012-09-22  7:16 ` [U-Boot] [PATCH v2 2/5] Add SDIO/MMC support for kirkwood SoC DrEagle
2012-09-24  8:44   ` Prafulla Wadaskar
2012-09-22  7:17 ` [U-Boot] [PATCH v2 3/5] Add SDIO/MMC support for Sheevaplug board DrEagle
2012-09-24  8:46   ` Prafulla Wadaskar
2012-09-22  7:18 ` [U-Boot] [PATCH v2 4/5] Fix env address " DrEagle
2012-09-24  8:46   ` Prafulla Wadaskar
2012-09-26  5:35     ` DrEagle
2012-09-26  7:33       ` Prafulla Wadaskar
2012-09-22  7:18 ` DrEagle [this message]
2012-09-24  8:44   ` [U-Boot] [PATCH v2 5/5] Fix timeout in Marvell SDIO MMC driver Prafulla Wadaskar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=505D6656.5040108@doukki.net \
    --to=dreagle@doukki.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox