mmc: sdhci-msm: update dma_mask for SDHC device
Set the dma_mask to 0xffffffff to indicate full 32-bit
address space and thus avoiding unnecessary buffers bouncing
from high to low memory.
Change-Id: Idaffe14d4e54a27b15e5a5d82dad41d843714d57
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[xiaonian@codeaurora.org: fix trivial merge conflict]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c
index 22338c7..7e3cdec 100644
--- a/drivers/mmc/host/sdhci-msm.c
+++ b/drivers/mmc/host/sdhci-msm.c
@@ -33,6 +33,7 @@
#include <linux/slab.h>
#include <linux/mmc/mmc.h>
#include <linux/mmc/slot-gpio.h>
+#include <linux/dma-mapping.h>
#include <linux/msm-bus.h>
#include "sdhci-pltfm.h"
@@ -1793,6 +1794,13 @@
}
}
+ if (dma_supported(mmc_dev(host->mmc), DMA_BIT_MASK(32))) {
+ host->dma_mask = DMA_BIT_MASK(32);
+ mmc_dev(host->mmc)->dma_mask = &host->dma_mask;
+ } else {
+ dev_err(&pdev->dev, "%s: Failed to set dma mask\n", __func__);
+ }
+
ret = sdhci_add_host(host);
if (ret) {
dev_err(&pdev->dev, "Add host failed (%d)\n", ret);