]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: sdhci: skip cache invalidation if DMA is not used
authorYuezhang.Mo@sony.com <Yuezhang.Mo@sony.com>
Thu, 14 Jan 2021 05:46:50 +0000 (05:46 +0000)
committerPeng Fan <peng.fan@nxp.com>
Fri, 19 Feb 2021 07:03:25 +0000 (15:03 +0800)
If DMA(SDMA or ADMA) is not used, the cache invalidation
after reading is no need, should be skipped. Otherwise
U-Boot may hang at the cache invalidation.

Found this issue and tested this fix on DragonBoard 410c.

Fixes: commit 4155ad9aac94 ("mmc: sdhci: fix missing cache invalidation after reading by DMA")
Signed-off-by: Yuezhang.Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
drivers/mmc/sdhci.c

index 5f18d472bd1df9ca3dc42133c060126b20311572..d9ab6a0a839ef4cb6d782ba97c643201698394e8 100644 (file)
@@ -177,8 +177,10 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data)
                }
        } while (!(stat & SDHCI_INT_DATA_END));
 
+#if (defined(CONFIG_MMC_SDHCI_SDMA) || CONFIG_IS_ENABLED(MMC_SDHCI_ADMA))
        dma_unmap_single(host->start_addr, data->blocks * data->blocksize,
                         mmc_get_dma_dir(data));
+#endif
 
        return 0;
 }