mmc: dw_mmc: fix the max_blk_count in IDMAC
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 27 Oct 2015 09:53:06 +0000 (17:53 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Tue, 27 Oct 2015 10:13:21 +0000 (18:13 +0800)
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 <tgih.jun@samsung.com>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Alim Akhtar <alim.akhtar@samsung.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/rk_sdmmc.c

index 9debc5f08e980c22c4f45a2c97f64a1a331448cc..352a7846eb8557170f48fe87fdd94aa92d6c7569 100755 (executable)
@@ -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;