From patchwork Fri Mar 18 22:11:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 645541 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2IMCpGj005577 for ; Fri, 18 Mar 2011 22:12:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932931Ab1CRWMR (ORCPT ); Fri, 18 Mar 2011 18:12:17 -0400 Received: from mail.atheros.com ([12.19.149.2]:44350 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932890Ab1CRWMK (ORCPT ); Fri, 18 Mar 2011 18:12:10 -0400 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Fri, 18 Mar 2011 15:11:47 -0700 Received: from tux (10.10.11.73) by SC1EXHC-02.global.atheros.com (10.10.20.106) with Microsoft SMTP Server (TLS) id 8.2.213.0; Fri, 18 Mar 2011 15:12:08 -0700 Received: by tux (sSMTP sendmail emulation); Fri, 18 Mar 2011 15:12:07 -0700 From: "Luis R. Rodriguez" To: CC: , , , , , , "Luis R. Rodriguez" , Naveen Singh , Vipin Mehta Subject: [RFC 1/4] sdhci: allow for multiple delays when sending commands Date: Fri, 18 Mar 2011 15:11:57 -0700 Message-ID: <1300486320-23607-2-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.7.4.15.g7811d In-Reply-To: <1300486320-23607-1-git-send-email-lrodriguez@atheros.com> References: <1300486320-23607-1-git-send-email-lrodriguez@atheros.com> MIME-Version: 1.0 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 (demeter1.kernel.org [140.211.167.41]); Fri, 18 Mar 2011 22:12:51 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9e15f41..c95dfc2 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -891,8 +891,8 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) WARN_ON(host->cmd); - /* Wait max 10 ms */ - timeout = 10; + /* Wait max this amount of ms */ + timeout = (10*256) + 255; mask = SDHCI_CMD_INHIBIT; if ((cmd->data != NULL) || (cmd->flags & MMC_RSP_BUSY)) @@ -913,7 +913,8 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) return; } timeout--; - mdelay(1); + if (!(timeout & 0xFF)) + mdelay(1); } mod_timer(&host->timer, jiffies + 10 * HZ);