[U-Boot] [PATCH] mmc: sdhci: only flush cache for data command

Jaehoon Chung jh80.chung at samsung.com
Tue Mar 14 07:08:17 UTC 2017


Hi Kevin,

On 03/08/2017 04:16 PM, Kevin Liu wrote:
> No need to flush cache for command without data.
> 
> Signed-off-by: Kevin Liu <kevinliu at asrmicro.com>

Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/sdhci.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 93cefd8..c94d58d 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);
> 



More information about the U-Boot mailing list