Browse Source

mmc: sdhci: only flush cache for data command

No need to flush cache for command without data.

Signed-off-by: Kevin Liu <kevinliu@asrmicro.com>
Kevin Liu 8 years ago
parent
commit
fa7720b21e
1 changed files with 4 additions and 2 deletions
  1. 4 2
      drivers/mmc/sdhci.c

+ 4 - 2
drivers/mmc/sdhci.c

@@ -242,8 +242,10 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 
 	sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
 #ifdef CONFIG_MMC_SDHCI_SDMA
-	trans_bytes = ALIGN(trans_bytes, CONFIG_SYS_CACHELINE_SIZE);
-	flush_cache(start_addr, trans_bytes);
+	if (data != 0) {
+		trans_bytes = ALIGN(trans_bytes, CONFIG_SYS_CACHELINE_SIZE);
+		flush_cache(start_addr, trans_bytes);
+	}
 #endif
 	sdhci_writew(host, SDHCI_MAKE_CMD(cmd->cmdidx, flags), SDHCI_COMMAND);
 	start = get_timer(0);