From 8312c2733ca2b9e1added218ae6f883ee3500963 Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Tue, 27 Oct 2015 17:53:06 +0800 Subject: [PATCH] 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 --- drivers/mmc/host/rk_sdmmc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.34.1