From patchwork Fri Aug 26 07:55:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunhe Lan X-Patchwork-Id: 1101272 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7Q8w0Nh027829 for ; Fri, 26 Aug 2011 08:58:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753756Ab1HZI6B (ORCPT ); Fri, 26 Aug 2011 04:58:01 -0400 Received: from db3ehsobe003.messaging.microsoft.com ([213.199.154.141]:12955 "EHLO DB3EHSOBE003.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753730Ab1HZI55 (ORCPT ); Fri, 26 Aug 2011 04:57:57 -0400 Received: from mail60-db3-R.bigfish.com (10.3.81.241) by DB3EHSOBE003.bigfish.com (10.3.84.23) with Microsoft SMTP Server id 14.1.225.22; Fri, 26 Aug 2011 08:57:56 +0000 Received: from mail60-db3 (localhost.localdomain [127.0.0.1]) by mail60-db3-R.bigfish.com (Postfix) with ESMTP id AE7B31C98168; Fri, 26 Aug 2011 08:57:56 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh2a8h668h839h65h) X-Spam-TCS-SCL: 4:0 X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPVD:NLI; H:mail.freescale.net; RD:none; EFVD:NLI Received: from mail60-db3 (localhost.localdomain [127.0.0.1]) by mail60-db3 (MessageSwitch) id 1314349076551691_11430; Fri, 26 Aug 2011 08:57:56 +0000 (UTC) Received: from DB3EHSMHS009.bigfish.com (unknown [10.3.81.240]) by mail60-db3.bigfish.com (Postfix) with ESMTP id 8320BCF004B; Fri, 26 Aug 2011 08:57:56 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS009.bigfish.com (10.3.87.109) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 26 Aug 2011 08:57:53 +0000 Received: from az33smr01.freescale.net (10.64.34.199) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server id 14.1.323.2; Fri, 26 Aug 2011 03:57:35 -0500 Received: from localhost.localdomain (rock.ap.freescale.net [10.193.20.106]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p7Q8vXWv020682; Fri, 26 Aug 2011 03:57:33 -0500 (CDT) From: Chunhe Lan To: CC: , , Chunhe Lan , Shengzhou Liu , Chris Ball Subject: [PATCH 3/3 v2] mmc: Use mmc_delay() instead of mdelay() for time delay Date: Fri, 26 Aug 2011 15:55:10 +0800 Message-ID: <1314345310-15041-1-git-send-email-Chunhe.Lan@freescale.com> X-Mailer: git-send-email 1.6.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 26 Aug 2011 08:58:04 +0000 (UTC) The mmc_delay() is a wrapper function for mdelay() and msleep(). o mdelay() -- block the system when busy-waiting. o msleep() -- suspend the currently running task to enable CPU to process other tasks, so it is non-blocking regarding the whole system. When the desired delay time is more than a period of timer interrupt, just use msleep(). Change mdelay() to mmc_delay() to avoid chewing CPU when busy wait. Signed-off-by: Shengzhou Liu Signed-off-by: Chunhe Lan Cc: Chris Ball --- drivers/mmc/host/sdhci.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 0e02cc1..b0cf79f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -186,7 +186,7 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) return; } timeout--; - mdelay(1); + mmc_delay(1); } if (host->ops->platform_reset_exit) @@ -957,7 +957,7 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) return; } timeout--; - mdelay(1); + mmc_delay(1); } mod_timer(&host->timer, jiffies + 10 * HZ); @@ -1127,7 +1127,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) return; } timeout--; - mdelay(1); + mmc_delay(1); } clk |= SDHCI_CLOCK_CARD_EN; @@ -1192,7 +1192,7 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned short power) * can apply clock after applying power */ if (host->quirks & SDHCI_QUIRK_DELAY_AFTER_POWER) - mdelay(10); + mmc_delay(10); } /*****************************************************************************\ @@ -1712,7 +1712,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc) ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); tuning_loop_counter--; timeout--; - mdelay(1); + mmc_delay(1); } while (ctrl & SDHCI_CTRL_EXEC_TUNING); /*