From patchwork Fri May 24 16:00:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremie Samuel X-Patchwork-Id: 2611891 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A2D073FD4E for ; Fri, 24 May 2013 16:01:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754791Ab3EXQBg (ORCPT ); Fri, 24 May 2013 12:01:36 -0400 Received: from co202.xi-lite.net ([149.6.83.202]:35680 "EHLO co202.xi-lite.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755521Ab3EXQBe (ORCPT ); Fri, 24 May 2013 12:01:34 -0400 Received: from ONYX.xi-lite.lan (unknown [193.34.35.244]) by co202.xi-lite.net (Postfix) with ESMTPS id AEEC1260363; Fri, 24 May 2013 18:18:55 +0200 (CEST) Received: from debian.parrot.biz (46.218.109.88) by mail.xi-lite.com (193.34.32.105) with Microsoft SMTP Server (TLS) id 8.1.336.0; Fri, 24 May 2013 17:01:52 +0100 From: Jeremie Samuel To: , Chris Ball CC: , , Jeremie Samuel , Anton Vorontsov Subject: [PATCH 7/8] sdhci: Get rid of mdelay()s where it is safe and makes sense Date: Fri, 24 May 2013 18:00:41 +0200 Message-ID: <1369411242-20515-8-git-send-email-jeremie.samuel.ext@parrot.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369411242-20515-1-git-send-email-jeremie.samuel.ext@parrot.com> References: <1369411242-20515-1-git-send-email-jeremie.samuel.ext@parrot.com> MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.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. PAtch based on: http://thread.gmane.org/gmane.linux.kernel.mmc/2579. Signed-off-by: Anton Vorontsov Signed-off-by: Jeremie Samuel --- drivers/mmc/host/sdhci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 10a7684..4a6b716 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -209,7 +209,7 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) return; } timeout--; - mdelay(1); + msleep(1); } if (host->ops->platform_reset_exit) @@ -1226,7 +1226,7 @@ clock_set: return; } timeout--; - mdelay(1); + msleep(1); } clk |= SDHCI_CLOCK_CARD_EN; @@ -1300,7 +1300,7 @@ static int 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); return power; } @@ -1955,7 +1955,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode) ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); tuning_loop_counter--; timeout--; - mdelay(1); + msleep(1); } while (ctrl & SDHCI_CTRL_EXEC_TUNING); /*