From patchwork Wed Oct 16 16:20:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremie Samuel X-Patchwork-Id: 3054351 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 15C1ABF924 for ; Wed, 16 Oct 2013 16:22:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01AD9204B0 for ; Wed, 16 Oct 2013 16:22:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CF995204AD for ; Wed, 16 Oct 2013 16:22:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932605Ab3JPQWg (ORCPT ); Wed, 16 Oct 2013 12:22:36 -0400 Received: from co202.xi-lite.net ([149.6.83.202]:33774 "EHLO co202.xi-lite.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932589Ab3JPQWg (ORCPT ); Wed, 16 Oct 2013 12:22:36 -0400 Received: from localhost (localhost [127.0.0.1]) by co202.xi-lite.net (Postfix) with ESMTP id 4A0CF4809B6; Wed, 16 Oct 2013 18:22:35 +0200 (CEST) X-Virus-Scanned: amavisd-new at fw.aswsp.net Received: from co202.xi-lite.net ([127.0.0.1]) by localhost (fw.aswsp.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id SzYw-K3eVeik; Wed, 16 Oct 2013 18:22:35 +0200 (CEST) Received: from HCAS2.aswsp.lan (unknown [193.34.35.150]) by co202.xi-lite.net (Postfix) with ESMTPS id 3A09A4809B5; Wed, 16 Oct 2013 18:22:35 +0200 (CEST) Received: from jerk.parrot.biz (46.218.109.88) by smtp.aswsp.com (193.34.32.148) with Microsoft SMTP Server id 14.2.342.3; Wed, 16 Oct 2013 18:22:59 +0200 From: Jeremie Samuel To: Chris Ball CC: , =?UTF-8?q?Gr=C3=A9gor=20Boirie?= , Matthieu Castet , Jeremie Samuel , Anton Vorontsov Subject: [PATCH 7/8] sdhci: Get rid of mdelay()s where it is safe and makes sense Date: Wed, 16 Oct 2013 18:20:57 +0200 Message-ID: <1381940458-12628-8-git-send-email-jeremie.samuel.ext@parrot.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1381940458-12628-1-git-send-email-jeremie.samuel.ext@parrot.com> References: <1381940458-12628-1-git-send-email-jeremie.samuel.ext@parrot.com> MIME-Version: 1.0 X-Originating-IP: [46.218.109.88] Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 ce7c99b..843e99d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -220,7 +220,7 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) return; } timeout--; - mdelay(1); + msleep(1); } if (host->ops->platform_reset_exit) @@ -1238,7 +1238,7 @@ clock_set: return; } timeout--; - mdelay(1); + msleep(1); } clk |= SDHCI_CLOCK_CARD_EN; @@ -1317,7 +1317,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; } @@ -1979,7 +1979,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); /*