diff options
author | Sonny Rao <sonnyrao@chromium.org> | 2014-10-16 12:58:05 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2014-11-10 06:40:35 -0500 |
commit | 536f6b91d21b81bec6c8a675b3a00052ee05f986 (patch) | |
tree | c9e998819fd46fc6a64bd0b12bcfcf7cef86a511 /drivers/mmc | |
parent | 390e316c606de2f839389698f4531004cfe1bafd (diff) |
mmc: dw_mmc: Reset DMA before enabling IDMAC
We've already got a reset of DMA after it's done. Add one before we
start DMA too. This fixes a data corruption on Rockchip SoCs which
will get bad data when doing a DMA transfer after doing a PIO transfer.
We tested this on an Exynos 5800 with HS200 and didn't notice any
difference in sequential read throughput.
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 69f0cc68d5b2..ca67f6923bfd 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -83,6 +83,7 @@ struct idmac_desc { | |||
83 | #endif /* CONFIG_MMC_DW_IDMAC */ | 83 | #endif /* CONFIG_MMC_DW_IDMAC */ |
84 | 84 | ||
85 | static bool dw_mci_reset(struct dw_mci *host); | 85 | static bool dw_mci_reset(struct dw_mci *host); |
86 | static bool dw_mci_ctrl_reset(struct dw_mci *host, u32 reset); | ||
86 | 87 | ||
87 | #if defined(CONFIG_DEBUG_FS) | 88 | #if defined(CONFIG_DEBUG_FS) |
88 | static int dw_mci_req_show(struct seq_file *s, void *v) | 89 | static int dw_mci_req_show(struct seq_file *s, void *v) |
@@ -448,6 +449,10 @@ static void dw_mci_idmac_start_dma(struct dw_mci *host, unsigned int sg_len) | |||
448 | 449 | ||
449 | dw_mci_translate_sglist(host, host->data, sg_len); | 450 | dw_mci_translate_sglist(host, host->data, sg_len); |
450 | 451 | ||
452 | /* Make sure to reset DMA in case we did PIO before this */ | ||
453 | dw_mci_ctrl_reset(host, SDMMC_CTRL_DMA_RESET); | ||
454 | dw_mci_idmac_reset(host); | ||
455 | |||
451 | /* Select IDMAC interface */ | 456 | /* Select IDMAC interface */ |
452 | temp = mci_readl(host, CTRL); | 457 | temp = mci_readl(host, CTRL); |
453 | temp |= SDMMC_CTRL_USE_IDMAC; | 458 | temp |= SDMMC_CTRL_USE_IDMAC; |