浏览代码

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>
Russell King 9 年之前
父节点
当前提交
f48f039cd2
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      drivers/mmc/host/sdhci.c

+ 1 - 2
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);