From 66aed496d55175095110eca603bd70eb79e1e790 Mon Sep 17 00:00:00 2001 From: Grazvydas Ignotas Date: Sun, 7 Feb 2016 19:03:07 +0200 Subject: [PATCH] omap_hsmmc: be more conservative with dma params dgame reported something what seems to be a SD read corruption he is getting after a palemoon crash. After more testing done by him it seems to be caused by 9e0b4807ca06, so only limit the tuned params to MMC3 now to still get the wifi benefit. Also revert parameters that are not helping wifi, just to be safe: - OMAP_DMA_DST_SYNC_PREFETCH - OMAP_DMA_WRITE_LAST_NON_POSTED Testing is difficult and only dgame can reproduce it, so the exact cause of his issue remains unclear. --- drivers/mmc/host/omap_hsmmc.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 3c4a0e45d715..6a960c15d76b 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -1380,17 +1380,16 @@ static void omap_hsmmc_config_dma_params_once(struct omap_hsmmc_host *host, struct mmc_data *data, int dma_ch) { + /* pandora hack: only benefits wifi, so only set there, just in case */ + if (host->id != OMAP_MMC3_DEVID) + return; + if (data->flags & MMC_DATA_WRITE) { - omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT, - (host->mapbase + OMAP_HSMMC_DATA), 0, 0); omap_set_dma_src_burst_mode(dma_ch, OMAP_DMA_DATA_BURST_16); omap_set_dma_src_data_pack(dma_ch, 1); } else { - omap_set_dma_src_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT, - (host->mapbase + OMAP_HSMMC_DATA), 0, 0); omap_set_dma_dest_burst_mode(dma_ch, OMAP_DMA_DATA_BURST_16); omap_set_dma_dest_data_pack(dma_ch, 1); - omap_set_dma_write_mode(dma_ch, OMAP_DMA_WRITE_LAST_NON_POSTED); } } @@ -1402,10 +1401,14 @@ static void omap_hsmmc_config_dma_params(struct omap_hsmmc_host *host, dma_ch = host->dma_ch; if (data->flags & MMC_DATA_WRITE) { + omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT, + (host->mapbase + OMAP_HSMMC_DATA), 0, 0); omap_set_dma_src_params(dma_ch, 0, OMAP_DMA_AMODE_POST_INC, sg_dma_address(sgl), 0, 0); - sync = OMAP_DMA_DST_SYNC_PREFETCH; + sync = OMAP_DMA_DST_SYNC; } else { + omap_set_dma_src_params(dma_ch, 0, OMAP_DMA_AMODE_CONSTANT, + (host->mapbase + OMAP_HSMMC_DATA), 0, 0); omap_set_dma_dest_params(dma_ch, 0, OMAP_DMA_AMODE_POST_INC, sg_dma_address(sgl), 0, 0); sync = OMAP_DMA_SRC_SYNC; -- 2.39.2