From 77d06da6c3b807984155e1f3eef72ea5f3e95c25 Mon Sep 17 00:00:00 2001 From: lintao Date: Tue, 17 Mar 2015 16:49:37 +0800 Subject: [PATCH] mmc: use ilog2 for fifoth calculation Signed-off-by: lintao --- drivers/mmc/host/rk_sdmmc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 69c3711c899c..227bc7efa9b2 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -46,6 +46,7 @@ #include #include #include +#include #include "rk_sdmmc.h" #include "rk_sdmmc_dbg.h" #include @@ -639,7 +640,9 @@ static void dw_mci_edmac_start_dma(struct dw_mci *host, unsigned int sg_len) if (mburst > burst_limit) { mburst = burst_limit; - fifoth_val = SDMMC_SET_FIFOTH(mszs[3], mszs[3] - 1, (host->fifo_depth) / 2); + fifoth_val = SDMMC_SET_FIFOTH(ilog2(mburst) - 1, + (host->fifo_depth) / 2 - 1, + (host->fifo_depth) / 2); mci_writel(host, FIFOTH, fifoth_val); } -- 2.34.1