From patchwork Fri Dec 21 09:28:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunhe Lan X-Patchwork-Id: 1902551 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 0C0FD3FC64 for ; Fri, 21 Dec 2012 09:26:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751445Ab2LUJ0c (ORCPT ); Fri, 21 Dec 2012 04:26:32 -0500 Received: from co1ehsobe003.messaging.microsoft.com ([216.32.180.186]:49826 "EHLO co1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751450Ab2LUJ0a (ORCPT ); Fri, 21 Dec 2012 04:26:30 -0500 Received: from mail51-co1-R.bigfish.com (10.243.78.202) by CO1EHSOBE002.bigfish.com (10.243.66.65) with Microsoft SMTP Server id 14.1.225.23; Fri, 21 Dec 2012 09:26:29 +0000 Received: from mail51-co1 (localhost [127.0.0.1]) by mail51-co1-R.bigfish.com (Postfix) with ESMTP id 0AD83A80207; Fri, 21 Dec 2012 09:26:29 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1de0h1202h1e76h1d1ah1d2ahzz8275bh8275dhz2dh2a8h668h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1155h) Received: from mail51-co1 (localhost.localdomain [127.0.0.1]) by mail51-co1 (MessageSwitch) id 1356081987868459_25768; Fri, 21 Dec 2012 09:26:27 +0000 (UTC) Received: from CO1EHSMHS027.bigfish.com (unknown [10.243.78.209]) by mail51-co1.bigfish.com (Postfix) with ESMTP id C8301C80061; Fri, 21 Dec 2012 09:26:27 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO1EHSMHS027.bigfish.com (10.243.66.37) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 21 Dec 2012 09:26:27 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.318.3; Fri, 21 Dec 2012 09:26:26 +0000 Received: from ustc.localdomain4 ([10.193.20.71]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id qBL9Q6w8018697; Fri, 21 Dec 2012 02:26:23 -0700 From: Chunhe Lan To: CC: , Chunhe Lan , Kumar Gala , Arnd Bergmann Subject: [v4 2/2] mmc: Use mmc_delay() instead of mdelay() for time delay Date: Fri, 21 Dec 2012 17:28:00 +0800 Message-ID: <1356082080-7756-2-git-send-email-Chunhe.Lan@freescale.com> X-Mailer: git-send-email 1.7.6.5 In-Reply-To: <1356082080-7756-1-git-send-email-Chunhe.Lan@freescale.com> References: <1356082080-7756-1-git-send-email-Chunhe.Lan@freescale.com> 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 The mmc_delay() is a wrapper function for cond_resched() and udelay(). o mdelay() block the system when busy-waiting. o cond_resched() suspend the currently running task to enable CPU to process other tasks, so it is non-blocking regarding the whole system. Change mdelay() to mmc_delay() to avoid chewing CPU when busy wait. Signed-off-by: Chunhe Lan Signed-off-by: Kumar Gala Cc: Arnd Bergmann Cc: Chris Ball --- drivers/mmc/host/sdhci-esdhc.h | 4 ++-- drivers/mmc/host/sdhci.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index d25f9ab..5e33732 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host/sdhci-esdhc.h @@ -1,7 +1,7 @@ /* * Freescale eSDHC controller driver generics for OF and pltfm. * - * Copyright (c) 2007 Freescale Semiconductor, Inc. + * Copyright (c) 2007, 2012 Freescale Semiconductor, Inc. * Copyright (c) 2009 MontaVista Software, Inc. * Copyright (c) 2010 Pengutronix e.K. * Author: Wolfram Sang @@ -73,7 +73,7 @@ static inline void esdhc_set_clock(struct sdhci_host *host, unsigned int clock) | (div << ESDHC_DIVIDER_SHIFT) | (pre_div << ESDHC_PREDIV_SHIFT)); sdhci_writel(host, temp, ESDHC_SYSTEM_CONTROL); - mdelay(1); + mmc_delay(1); out: host->clock = clock; } diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6f0bfc0..a20c4f0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -206,7 +206,7 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask) return; } timeout--; - mdelay(1); + mmc_delay(1); } if (host->ops->platform_reset_exit) @@ -998,7 +998,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); @@ -1179,7 +1179,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; @@ -1244,7 +1244,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); + mmc_delay(10); return power; } @@ -1895,7 +1895,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); + mmc_delay(1); } while (ctrl & SDHCI_CTRL_EXEC_TUNING); /*