diff options
author | Martin Fuzzey <mfuzzey@gmail.com> | 2009-04-16 22:00:36 +0200 |
---|---|---|
committer | Pierre Ossman <pierre@ossman.eu> | 2009-06-03 21:48:17 +0200 |
commit | 18489fa2ba4c170d96ffc1a41f7b9002dcb983b7 (patch) | |
tree | a5197a929582ef448c1d6891a489f8914dfe1506 /drivers | |
parent | 85b843227a9b8c1a27ebd354a80c89aef067f2ca (diff) | |
download | op-kernel-dev-18489fa2ba4c170d96ffc1a41f7b9002dcb983b7.zip op-kernel-dev-18489fa2ba4c170d96ffc1a41f7b9002dcb983b7.tar.gz |
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')
-rw-r--r-- | drivers/mmc/host/mxcmmc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index 5950102..dcc9cdb 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c @@ -140,6 +140,8 @@ struct mxcmci_host { struct work_struct datawork; }; +static void mxcmci_set_clk_rate(struct mxcmci_host *host, unsigned int clk_ios); + static inline int mxcmci_use_dma(struct mxcmci_host *host) { return host->do_dma; @@ -345,8 +347,11 @@ static int mxcmci_poll_status(struct mxcmci_host *host, u32 mask) stat = readl(host->base + MMC_REG_STATUS); if (stat & STATUS_ERR_MASK) return stat; - if (time_after(jiffies, timeout)) + if (time_after(jiffies, timeout)) { + mxcmci_softreset(host); + mxcmci_set_clk_rate(host, host->clock); return STATUS_TIME_OUT_READ; + } if (stat & mask) return 0; cpu_relax(); |