aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mxcmmc.c
diff options
context:
space:
mode:
authorMartin Fuzzey <mfuzzey@gmail.com>2009-04-16 16:00:36 -0400
committerPierre Ossman <pierre@ossman.eu>2009-06-03 15:48:17 -0400
commit18489fa2ba4c170d96ffc1a41f7b9002dcb983b7 (patch)
treea5197a929582ef448c1d6891a489f8914dfe1506 /drivers/mmc/host/mxcmmc.c
parent85b843227a9b8c1a27ebd354a80c89aef067f2ca (diff)
mxcmmc : Reset the SDHC hardware if software timeout occurs.
When a software timeout occurs in polling mode hardware was left in an indeterminate state causing subsequent operations to block. Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Diffstat (limited to 'drivers/mmc/host/mxcmmc.c')
-rw-r--r--drivers/mmc/host/mxcmmc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c
index 5950102113f4..dcc9cdb2a4df 100644
--- a/drivers/mmc/host/mxcmmc.c
+++ b/drivers/mmc/host/mxcmmc.c
@@ -140,6 +140,8 @@ struct mxcmci_host {
140 struct work_struct datawork; 140 struct work_struct datawork;
141}; 141};
142 142
143static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios);
144
143static inline int mxcmci_use_dma(struct mxcmci_host *host) 145static inline int mxcmci_use_dma(struct mxcmci_host *host)
144{ 146{
145 return host->do_dma; 147 return host->do_dma;
@@ -345,8 +347,11 @@ static int mxcmci_poll_status(struct mxcmci_host *host, u32 mask)
345 stat = readl(host->base + MMC_REG_STATUS); 347 stat = readl(host->base + MMC_REG_STATUS);
346 if (stat & STATUS_ERR_MASK) 348 if (stat & STATUS_ERR_MASK)
347 return stat; 349 return stat;
348 if (time_after(jiffies, timeout)) 350 if (time_after(jiffies, timeout)) {
351 mxcmci_softreset(host);
352 mxcmci_set_clk_rate(host, host->clock);
349 return STATUS_TIME_OUT_READ; 353 return STATUS_TIME_OUT_READ;
354 }
350 if (stat & mask) 355 if (stat & mask)
351 return 0; 356 return 0;
352 cpu_relax(); 357 cpu_relax();