diff mbox

[U-Boot] mmc: sdhci: fix the "misaligned operation at range" for cache

Message ID 1476322386-3419-1-git-send-email-jh80.chung@samsung.com
State Accepted
Commit be256cbf0456865471ff63dd7579cd6404574c44
Delegated to: Jaehoon Chung
Headers show

Commit Message

Jaehoon Chung Oct. 13, 2016, 1:33 a.m. UTC
This pathc is fixed the below thing.
If misaligned the cache range, Just flush to CACHLINE_SIZE.
"CACHE: Misaligned operation at range [7ae55b00, 7ae55b08]"

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/sdhci.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Jaehoon Chung Oct. 21, 2016, 4:34 a.m. UTC | #1
On 10/13/2016 10:33 AM, Jaehoon Chung wrote:
> This pathc is fixed the below thing.
> If misaligned the cache range, Just flush to CACHLINE_SIZE.
> "CACHE: Misaligned operation at range [7ae55b00, 7ae55b08]"
> 

Applied on u-boot-mmc. Thanks!

Best Regards,
Jaehoon Chung

> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  drivers/mmc/sdhci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 837c538..10ff57e 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -242,6 +242,7 @@ static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>  
>  	sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
>  #ifdef CONFIG_MMC_SDMA
> +	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);
>
diff mbox

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 837c538..10ff57e 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -242,6 +242,7 @@  static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
 
 	sdhci_writel(host, cmd->cmdarg, SDHCI_ARGUMENT);
 #ifdef CONFIG_MMC_SDMA
+	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);