summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKevin Liu <[email protected]>2017-03-08 15:16:44 +0800
committerStefan Roese <[email protected]>2017-03-29 07:38:06 +0200
commit5b3e5b56969cb61d73a7c293679ba1536a94e70e (patch)
treebf3ac77bf6b27ce2e3c1d3500519e77a3aa78c25 /drivers
parentaff32df522e5b1a7e4391fd00ffe14a3f107fcd3 (diff)
mmc: sdhci: only flush cache for data command
No need to flush cache for command without data. Signed-off-by: Kevin Liu <[email protected]>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/sdhci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 93cefd89cd4..c94d58db65c 100644
--- a/drivers/mmc/sdhci.c
+++ b/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);