diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2016-06-29 16:24:30 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-07-25 10:34:41 +0200 |
commit | 5a8a3fef26cea4ab1fd023a20bb5b8f0bd87ce77 (patch) | |
tree | 707881a7cab91e967a5435118c5ccaf12602f216 /drivers/mmc | |
parent | ed1563de0bc90e09d9707a85cf8d0e958c6f6261 (diff) |
mmc: sdhci: Clear pointers when a request finishes
Several pointers are used to identify when interrupts are expected. Namely,
host->cmd, host->data_cmd and host->data. Ensure those are cleared when
a request finishes. That tidies the case when a request is errored out
before normal processing has completed, ensuring any interrupts that occur
subsequently are not acted upon.
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 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 320c294b9d73..dce31b798180 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -935,6 +935,15 @@ static bool sdhci_needs_reset(struct sdhci_host *host, struct mmc_request *mrq) static void sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) { + if (host->cmd && host->cmd->mrq == mrq) + host->cmd = NULL; + + if (host->data_cmd && host->data_cmd->mrq == mrq) + host->data_cmd = NULL; + + if (host->data && host->data->mrq == mrq) + host->data = NULL; + if (sdhci_needs_reset(host, mrq)) host->pending_reset = true; @@ -2240,9 +2249,6 @@ static void sdhci_tasklet_finish(unsigned long param) } host->mrq = NULL; - host->cmd = NULL; - host->data = NULL; - host->data_cmd = NULL; sdhci_led_deactivate(host); |