diff options
author | Andrew Gabbasov <andrew_gabbasov@mentor.com> | 2014-10-01 08:14:08 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-11-10 06:40:27 -0500 |
commit | fce9d33f51bf1d84270238885c2712d48a056e41 (patch) | |
tree | fe12477f963a91835b6e98d4cd27d8677b8f1f35 | |
parent | fbfaf0326b725cfbcc4169294cffefcad5ce64aa (diff) |
mmc: sdhci: fix error conditions for controller reset
Add the case of SET_BLOCK_COUNT command error to the error conditions
check for making a controller reset at request handling finish.
Otherwise, if the SET_BLOCK_COUNT command failed, e.g. with a timeout,
the controller state was not reset, and the next command failed too.
In the case of data error the controller reset is already done in
finish_data() function before sending stop command (if present),
so the finish tasklet should make a reset after data error only
if no stop command existed in the request.
Also, fix the indentation of this condition check to make it more logical.
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/sdhci.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 179ce06eec73..062222abf3df 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -2144,9 +2144,10 @@ static void sdhci_tasklet_finish(unsigned long param) | |||
2144 | */ | 2144 | */ |
2145 | if (!(host->flags & SDHCI_DEVICE_DEAD) && | 2145 | if (!(host->flags & SDHCI_DEVICE_DEAD) && |
2146 | ((mrq->cmd && mrq->cmd->error) || | 2146 | ((mrq->cmd && mrq->cmd->error) || |
2147 | (mrq->data && (mrq->data->error || | 2147 | (mrq->sbc && mrq->sbc->error) || |
2148 | (mrq->data->stop && mrq->data->stop->error))) || | 2148 | (mrq->data && ((mrq->data->error && !mrq->data->stop) || |
2149 | (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) { | 2149 | (mrq->data->stop && mrq->data->stop->error))) || |
2150 | (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) { | ||
2150 | 2151 | ||
2151 | /* Some controllers need this kick or reset won't work here */ | 2152 | /* Some controllers need this kick or reset won't work here */ |
2152 | if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) | 2153 | if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET) |