aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorYi Sun <yi.y.sun@intel.com>2014-09-08 22:13:59 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-09-24 05:03:17 -0400
commit7756a96d1617753d8387e59e0ba410e0dd512be4 (patch)
tree55686d4c3b43cbbb8726b4da6698f395b81cdc0a /drivers/mmc
parent528bc7808f4e36a330ec17ef22803f1345091494 (diff)
mmc: sdhci: execute tuning when device is not busy
We find tuning timeout because of the secure erase operation lasts too long, so don't do tuning when device is busy. Signed-off-by: Yi Sun <yi.y.sun@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci.c7
-rw-r--r--drivers/mmc/host/sdhci.h1
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index db113aba35d0..cbd433712756 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1366,11 +1366,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
1366 present_state = sdhci_readl(host, SDHCI_PRESENT_STATE); 1366 present_state = sdhci_readl(host, SDHCI_PRESENT_STATE);
1367 /* 1367 /*
1368 * Check if the re-tuning timer has already expired and there 1368 * Check if the re-tuning timer has already expired and there
1369 * is no on-going data transfer. If so, we need to execute 1369 * is no on-going data transfer and DAT0 is not busy. If so,
1370 * tuning procedure before sending command. 1370 * we need to execute tuning procedure before sending command.
1371 */ 1371 */
1372 if ((host->flags & SDHCI_NEEDS_RETUNING) && 1372 if ((host->flags & SDHCI_NEEDS_RETUNING) &&
1373 !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) { 1373 !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ)) &&
1374 (present_state & SDHCI_DATA_0_LVL_MASK)) {
1374 if (mmc->card) { 1375 if (mmc->card) {
1375 /* eMMC uses cmd21 but sd and sdio use cmd19 */ 1376 /* eMMC uses cmd21 but sd and sdio use cmd19 */
1376 tuning_opcode = 1377 tuning_opcode =
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 9828ff83d84c..31896a779d4e 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -72,6 +72,7 @@
72#define SDHCI_WRITE_PROTECT 0x00080000 72#define SDHCI_WRITE_PROTECT 0x00080000
73#define SDHCI_DATA_LVL_MASK 0x00F00000 73#define SDHCI_DATA_LVL_MASK 0x00F00000
74#define SDHCI_DATA_LVL_SHIFT 20 74#define SDHCI_DATA_LVL_SHIFT 20
75#define SDHCI_DATA_0_LVL_MASK 0x00100000
75 76
76#define SDHCI_HOST_CONTROL 0x28 77#define SDHCI_HOST_CONTROL 0x28
77#define SDHCI_CTRL_LED 0x01 78#define SDHCI_CTRL_LED 0x01