From: lintao Date: Tue, 17 Mar 2015 08:49:37 +0000 (+0800) Subject: mmc: use ilog2 for fifoth calculation X-Git-Tag: firefly_0821_release~4257 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=firefly-linux-kernel-4.4.55.git;a=commitdiff_plain;h=77d06da6c3b807984155e1f3eef72ea5f3e95c25 mmc: use ilog2 for fifoth calculation Signed-off-by: lintao --- 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); }