Skip to contentSkip to conversation

mmc: sdhci: skip cache invalidation if DMA is not used

PATCH New Yuezhang.Mo at sony.com 2 participants 2 messages Jan 14, 2021 – Jan 15, 2021 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci: skip cache invalidation if DMA is not used

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")
---
 drivers/mmc/sdhci.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mmc/sdhci.c +2 -0
index 0628934312..29099199a7 100644
@@ -174,8 +174,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;
 }
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 mmc: sdhci: skip cache invalidation if DMA is not used

The config usage keep the same style as function sdhci_prepare_dma().

drivers/mmc/sdhci.c static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data) · line 180

Quoted 4 lines
drivers/mmc/sdhci.c +2 -0
+#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 

--
Sent from: http://u-boot.10912.n7.nabble.com/