From: Shawn Lin Date: Tue, 27 Oct 2015 09:53:06 +0000 (+0800) Subject: mmc: dw_mmc: fix the max_blk_count in IDMAC X-Git-Tag: firefly_0821_release~3676 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8312c2733ca2b9e1added218ae6f883ee3500963;p=firefly-linux-kernel-4.4.55.git mmc: dw_mmc: fix the max_blk_count in IDMAC Even though 1MB is reserved for descriptor table in IDMAC, the dw_mmc host driver is allowed to receive only maximum 128KB block length in one request. This is caused by setting improper max_blk_count. It needs to be e adjusted so that descriptor table is used fully. It is found that the performance is improved with the increased the max_blk_count. Change-Id: Ie4042f9e1924e0f575b9865aa721b7b61305c13d Signed-off-by: Seungwon Jeon Acked-by: Jaehoon Chung Signed-off-by: Alim Akhtar Reviewed-by: Shawn Lin Signed-off-by: Shawn Lin Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/rk_sdmmc.c b/drivers/mmc/host/rk_sdmmc.c index 9debc5f08e98..352a7846eb85 100755 --- a/drivers/mmc/host/rk_sdmmc.c +++ b/drivers/mmc/host/rk_sdmmc.c @@ -3668,9 +3668,10 @@ static int dw_mci_init_slot(struct dw_mci *host, unsigned int id) #ifdef CONFIG_MMC_DW_IDMAC mmc->max_segs = host->ring_size; mmc->max_blk_size = 65536; - mmc->max_blk_count = host->ring_size; mmc->max_seg_size = 0x1000; - mmc->max_req_size = mmc->max_seg_size * mmc->max_blk_count; + mmc->max_req_size = mmc->max_seg_size * host->ring_size; + mmc->max_blk_count = mmc->max_req_size / 512; + if(cpu_is_rk3036() || cpu_is_rk312x()){ /* fixup for external dmac setting */ mmc->max_segs = 64;