summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:26:28 -0600
committerQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:26:28 -0600
commit3c26454dc04f150f577049bf1f1adf6c999f126b (patch)
treee9d3491348ed220585f6c9d040df9025b66185eb
parent5b82378eeccb61decc379e84d308afb1dc8e5954 (diff)
CR ENGR00052514 refresh of ENGR0045732 to fix MMC read data corruption
Patch for CR ENGR00052514 refresh of ENGR0045732 to fix MMC read data corruption. This patch ports 1) Changes for ENGR00045732: Fix for MMC read data corruption problem from the 2.6.18 kernel mmc driver to the 2.6.22 kernel driver. 2) Code in mxcmci_finish_request which had accidently been dropped has been reinserted. Applies to MX platforms. http://www.bitshrine.org/gpp/linux-2.6.22-mx-CR-ENGR00052514-refresh-of-ENGR0045732-to-.patch
-rw-r--r--drivers/mmc/host/mxc_mmc.c11
-rw-r--r--include/linux/mmc/core.h2
2 files changed, 12 insertions, 1 deletions
diff --git a/drivers/mmc/host/mxc_mmc.c b/drivers/mmc/host/mxc_mmc.c
index 261952a37ad0..dd118cc1bb99 100644
--- a/drivers/mmc/host/mxc_mmc.c
+++ b/drivers/mmc/host/mxc_mmc.c
@@ -512,7 +512,13 @@ static void mxcmci_start_cmd(struct mxcmci_host *host, struct mmc_command *cmd,
__raw_writel(cmdat, host->base + MMC_CMD_DAT_CONT);
- mxcmci_start_clock(host, true);
+ if (!(cmdat & CMD_DAT_CONT_DATA_ENABLE) || (cmdat & CMD_DAT_CONT_WRITE)) {
+ mxcmci_start_clock(host, true);
+ } else {
+ __raw_writel(STR_STP_CLK_IPG_CLK_GATE_DIS |
+ STR_STP_CLK_IPG_PERCLK_GATE_DIS,
+ host->base + MMC_STR_STP_CLK);
+ }
}
/*!
@@ -530,6 +536,9 @@ static void mxcmci_finish_request(struct mxcmci_host *host,
host->cmd = NULL;
host->data = NULL;
+ if (!(req->cmd->flags & MMC_KEEP_CLK_RUN)) {
+ mxcmci_stop_clock(host, true);
+ }
mmc_request_done(host->mmc, req);
}
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 15799e4c01ec..6ce5c4218fe8 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -48,6 +48,8 @@ struct mmc_command {
#define mmc_resp_type(cmd) ((cmd)->flags & (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC|MMC_RSP_BUSY|MMC_RSP_OPCODE))
+#define MMC_KEEP_CLK_RUN (1 << 31) /* Keep card clock on after request */
+
/*
* These are the command types.
*/