]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
MMC: Performance improvement for CONFIG_MMC_BLOCK_BOUNCE
authorPurushotam Kumar <a0876542@india.ti.com>
Mon, 19 May 2008 12:06:23 +0000 (17:36 +0530)
committerTony Lindgren <tony@atomide.com>
Wed, 21 May 2008 14:54:43 +0000 (07:54 -0700)
This patch will increase performance significantly.It is supposed that
larger/bounce buffers will be used by mmc core if CONFIG_MMC_BLOCK_BOUNCE is
defined. But, in the mmc core, size of buffer is set to mmc->max_req_size if
mmc->max_req_size is smaller than MMC_QUEUE_BOUNCESZ i.e. bounce buffer size
(which is 64KB).By default, mmc->max_req_size is set to 4K. So, buffers of 4K
will be used instead of 64K even if CONFIG_MMC_BLOCK_BOUNCE is defined without
this patch. This patches forces mmc core to use bounce buffer of size
MMC_QUEUE_BOUNCESZ and so performance is increased.
In my test environment, write and Read speed without this patch was
2.6Mbytes/sec and 2.7Mbytes/sec respectively whereas write and read performance
with this patch has jumped to 4.4Mbytes/sec and 5MBytes/sec, respectively.
This testing has been done on SD Extreme III high speed 2GB SD card using
FAT file system with help of dd command

Signed-off-by: Purushotam Kumar <purushotam@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mmc/host/omap_hsmmc.c

index d5d82a85ff00690224aec1c6a4a2e2a8ee253382..8fd0e8b8343f617ec523c8d5f1e3add1916238c9 100644 (file)
@@ -782,6 +782,15 @@ static int __init omap_mmc_probe(struct platform_device *pdev)
                else
                        host->dbclk_enabled = 1;
 
+#ifdef CONFIG_MMC_BLOCK_BOUNCE
+       mmc->max_phys_segs = 1;
+       mmc->max_hw_segs = 1;
+#endif
+       mmc->max_blk_size = 512;       /* Block Length at max can be 1024 */
+       mmc->max_blk_count = 0xFFFF;    /* No. of Blocks is 16 bits */
+       mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+       mmc->max_seg_size = mmc->max_req_size;
+
        mmc->ocr_avail = mmc_slot(host).ocr_mask;
        mmc->caps |= MMC_CAP_MULTIWRITE | MMC_CAP_MMC_HIGHSPEED |
                                MMC_CAP_SD_HIGHSPEED;