mmc: sdhci: shorten the interval to wait SDHCI_PRESENT_STATE set after sending cmd
PATCH 1/1 mmc: sdhci: shorten the interval to wait SDHCI_PRESENT_STATE set after sending cmd
From: Barry Song <[email protected]>
now we wait 1ms after every loop, in the worst case, 1ms will be wasted. that both decreases sd performance and increases cpu usage. This patch shorten the interval to 1us, then in the worst case, only 1us is wasted.
--- drivers/mmc/host/sdhci.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci.c +3 -3
@@ -935,8 +935,8 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)WARN_ON (host->cmd); -/* Wait max 10 ms */ - timeout =10 ; +/* Wait max 10000 us */ + timeout =10000 ; mask =SDHCI_CMD_INHIBIT ;if ((cmd->data !=NULL ) || (cmd->flags &MMC_RSP_BUSY ))
@@ -957,7 +957,7 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)return ; } timeout--; -mdelay (1 ); +udelay (1 ); }mod_timer (&host->timer, jiffies +10 *HZ );
Signature · 6 lines
1.7.1 Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
Hi,
2011/9/28 Barry Song <[email protected]>:
Quoted 9 lines
From: Barry Song <[email protected]>
now we wait 1ms after every loop, in the worst case, 1ms will be wasted. that both decreases sd performance and increases cpu usage. This patch shorten the interval to 1us, then in the worst case, only 1us is wasted.
Signed-off-by Barry Song <[email protected]>---
Cool! How much I/O perf did you gain?
A
2011/10/1 Andrei E. Warkentin <[email protected]>:
Quoted 10 lines
Hi,
2011/9/28 Barry Song <[email protected]>:
Quoted 7 lines
From: Barry Song <[email protected]>
now we wait 1ms after every loop, in the worst case, 1ms will be wasted. that both decreases sd performance and increases cpu usage. This patch shorten the interval to 1us, then in the worst case, only 1us is wasted.
Quoted 4 lines
Quoted 2 lines
Signed-off-by Barry Song <[email protected]>---
Cool! How much I/O perf did you gain?
A test was done by bonnie++ on csr prima2 with 2GB class 2 SD card.
before applying this patch:
Version 1.03e ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
SiRFPrima2 768M 2555 39 2737 0 3661 2 5947 91 13301 3 909.3 4
after applying this patch:
Version 1.03e ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
SiRFPrima2 768M 2611 40 2668 0 3675 2 5952 91 13302 3 952.2 4
Quoted 3 lines
A
-
-barry