summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
authorRussell King2016-01-26 14:40:32 +0100
committerUlf Hansson2016-02-29 11:03:21 +0100
commitf48f039cd2d33d01ba15e92018dc18a0ea68c764 (patch)
tree149c136e371531dad8396f63eb3b56cde15dc8c8 /drivers/mmc/host/sdhci.c
parentmmc: sdhci: pass the cookie into sdhci_pre_dma_transfer() (diff)
downloadkernel-qcow2-linux-f48f039cd2d33d01ba15e92018dc18a0ea68c764.tar.gz
kernel-qcow2-linux-f48f039cd2d33d01ba15e92018dc18a0ea68c764.tar.xz
kernel-qcow2-linux-f48f039cd2d33d01ba15e92018dc18a0ea68c764.zip
mmc: sdhci: always unmap a mapped data transfer in sdhci_post_req()
If the host cookie indicates that the data buffers of a request are mapped at sdhci_post_req() time, always unmap the data buffers. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 9321d4a5b4e6..393a1b077746 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2078,8 +2078,7 @@ static void sdhci_post_req(struct mmc_host *mmc, struct mmc_request *mrq,
struct sdhci_host *host = mmc_priv(mmc);
struct mmc_data *data = mrq->data;
- if (data->host_cookie == COOKIE_GIVEN ||
- data->host_cookie == COOKIE_MAPPED)
+ if (data->host_cookie != COOKIE_UNMAPPED)
dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len,
data->flags & MMC_DATA_WRITE ?
DMA_TO_DEVICE : DMA_FROM_DEVICE);