diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2016-06-29 16:24:36 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-07-25 10:34:44 +0200 |
commit | 33a57adb6be38fbf008e4cdbf6c7085ed269bd3c (patch) | |
tree | d0369865c25baa63b96c09b8f7c90aafb89063f7 /drivers/mmc | |
parent | 0293d50110fbe6ccbd2fd7e0478552ec8d27087a (diff) | |
download | linux-stable-33a57adb6be38fbf008e4cdbf6c7085ed269bd3c.tar.gz linux-stable-33a57adb6be38fbf008e4cdbf6c7085ed269bd3c.tar.bz2 linux-stable-33a57adb6be38fbf008e4cdbf6c7085ed269bd3c.zip |
mmc: sdhci: Do not reset cmd or data circuits that are in use
In order to support commands during data transfer, it will be possible to
need to reset the command circuit while the data circuit is in use, and
vice versa. It is now easy to determine whether the command or data circuit
is in use, and so just skip the corresponding reset if it is.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 229b467a409a..614d77694f17 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -986,9 +986,9 @@ static void sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) static void sdhci_finish_data(struct sdhci_host *host) { - struct mmc_data *data; + struct mmc_command *data_cmd = host->data_cmd; + struct mmc_data *data = host->data; - data = host->data; host->data = NULL; host->data_cmd = NULL; @@ -1022,7 +1022,8 @@ static void sdhci_finish_data(struct sdhci_host *host) * upon error conditions. */ if (data->error) { - sdhci_do_reset(host, SDHCI_RESET_CMD); + if (!host->cmd || host->cmd == data_cmd) + sdhci_do_reset(host, SDHCI_RESET_CMD); sdhci_do_reset(host, SDHCI_RESET_DATA); } @@ -2305,8 +2306,10 @@ static bool sdhci_request_done(struct sdhci_host *host) /* Spec says we should do both at the same time, but Ricoh controllers do not like that. */ - sdhci_do_reset(host, SDHCI_RESET_CMD); - sdhci_do_reset(host, SDHCI_RESET_DATA); + if (!host->cmd) + sdhci_do_reset(host, SDHCI_RESET_CMD); + if (!host->data_cmd) + sdhci_do_reset(host, SDHCI_RESET_DATA); host->pending_reset = false; } |