From patchwork Wed Jul 14 13:08:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 58902 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 2A53410090A for ; Wed, 14 Jul 2010 23:09:09 +1000 (EST) Received: by ozlabs.org (Postfix) id 83EC1100BF2; Wed, 14 Jul 2010 23:08:11 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from buildserver.ru.mvista.com (unknown [213.79.90.228]) by ozlabs.org (Postfix) with ESMTP id C57D8100B95 for ; Wed, 14 Jul 2010 23:08:10 +1000 (EST) Received: from localhost (unknown [10.150.0.9]) by buildserver.ru.mvista.com (Postfix) with ESMTP id 717E1881F; Wed, 14 Jul 2010 18:08:09 +0500 (SAMST) Date: Wed, 14 Jul 2010 17:08:09 +0400 From: Anton Vorontsov To: Andrew Morton Subject: [PATCH 7/8] sdhci: Get rid of mdelay()s where it is safe and makes sense Message-ID: <20100714130809.GG517@oksana.dev.rtsoft.ru> References: <20100714130728.GA27339@oksana.dev.rtsoft.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100714130728.GA27339@oksana.dev.rtsoft.ru> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Matt Fleming , Albert Herranz , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, Ben Dooks , Pierre Ossman X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Since we don't run in the atomic context any longer, we can turn mdelay()s into msleep()s. The only place where the driver is still using mdelay() is sdhci_send_command(). There it is possible to use sleepable delays too, but we don't actually want to force rescheduling in a hot path. Sure, we might end up calling msleep() there too, just not via this safe patch. Signed-off-by: Anton Vorontsov --- drivers/mmc/host/sdhci-of-esdhc.c | 2 +- drivers/mmc/host/sdhci.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index c8623de..e9f99fe 100644 --- a/drivers/mmc/host/sdhci-of-esdhc.c +++ b/drivers/mmc/host/sdhci-of-esdhc.c @@ -94,7 +94,7 @@ static void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) setbits32(host->ioaddr + ESDHC_SYSTEM_CONTROL, ESDHC_CLOCK_IPGEN | ESDHC_CLOCK_HCKEN | ESDHC_CLOCK_PEREN | div << ESDHC_DIVIDER_SHIFT | pre_div << ESDHC_PREDIV_SHIFT); - mdelay(100); + msleep(100); out: host->clock = clock; } diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 56d5c56..e6adda8 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -171,7 +171,7 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) return; } timeout--; - mdelay(1); + msleep(1); } if (host->quirks & SDHCI_QUIRK_RESTORE_IRQS_AFTER_RESET) @@ -1019,7 +1019,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) return; } timeout--; - mdelay(1); + msleep(1); } clk |= SDHCI_CLOCK_CARD_EN; @@ -1086,7 +1086,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); + msleep(10); } /*****************************************************************************\