The Linux driver uses a 2000msec delay, so do the same.
Suggested-by: Pantelis Antoniou <[email protected]>
Signed-off-by: Ian Campbell <[email protected]>
---
drivers/mmc/sunxi_mmc.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/sunxi_mmc.c b/drivers/mmc/sunxi_mmc.c
index 141c436..2c3e236 100644
--- a/drivers/mmc/sunxi_mmc.c
+++ b/drivers/mmc/sunxi_mmc.c
@@ -225,16 +225,17 @@ static int mmc_update_clk(struct mmc *mmc)
{
struct sunxi_mmc_host *mmchost = (struct sunxi_mmc_host *)mmc->priv;
unsigned int cmd;
- unsigned timeout = 0xfffff;
+ unsigned timeout_msecs = 2000;
cmd = SUNXI_MMC_CMD_START |
SUNXI_MMC_CMD_UPCLK_ONLY |
SUNXI_MMC_CMD_WAIT_PRE_OVER;
writel(cmd, &mmchost->reg->cmd);
- while ((readl(&mmchost->reg->cmd) & SUNXI_MMC_CMD_START) && timeout--)
- ;
- if (!timeout)
- return -1;
+ while (readl(&mmchost->reg->cmd) & SUNXI_MMC_CMD_START) {
+ if (!timeout_msecs--)
+ return -1;
+ udelay(1000);
+ }
/* clock update sets various irq status bits, clear these */
writel(readl(&mmchost->reg->rint), &mmchost->reg->rint);
--
1.9.0
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.