From patchwork Fri Jan 21 19:30:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Rakity X-Patchwork-Id: 496261 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 p0LJWJ3S007869 for ; Fri, 21 Jan 2011 19:32:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754876Ab1AUTcT (ORCPT ); Fri, 21 Jan 2011 14:32:19 -0500 Received: from na3sys009aog102.obsmtp.com ([74.125.149.69]:46207 "HELO na3sys009aog102.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1754882Ab1AUTcS convert rfc822-to-8bit (ORCPT ); Fri, 21 Jan 2011 14:32:18 -0500 Received: from source ([65.219.4.130]) (using TLSv1) by na3sys009aob102.postini.com ([74.125.148.12]) with SMTP ID DSNKTTnfQsHHVJUDznqbAxNGBOz/mk/RweRa@postini.com; Fri, 21 Jan 2011 11:32:18 PST Received: from SC-vEXCH3.marvell.com ([10.93.76.133]) by sc-owa02.marvell.com ([10.93.76.22]) with mapi; Fri, 21 Jan 2011 11:30:30 -0800 From: Philip Rakity To: "linux-mmc@vger.kernel.org" CC: Mark Brown Date: Fri, 21 Jan 2011 11:30:30 -0800 Subject: [PATCH] sdhci: add ops to force delay in operations due to silicon issues Thread-Topic: [PATCH] sdhci: add ops to force delay in operations due to silicon issues Thread-Index: Acu5oaoPdBekoLCISZW5B8PALQ4OrQ== Message-ID: <84845C3D-FBE0-4F4B-AA9C-4EAD9DA316C9@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US 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, 21 Jan 2011 19:32:19 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6486009..ff9d5f0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -922,6 +922,14 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) mdelay(1); } + /* + * we cannot talk to controller for 8 bus cycles according to sdio spec + * at lowest speed this is 100,000 HZ per cycle or 800,000 cycles + * which is quite a LONG TIME on a fast cpu -- so delay if needed + */ + if (host->ops->platform_specific_delay) + host->ops->platform_specific_delay(host); + mod_timer(&host->timer, jiffies + 10 * HZ); host->cmd = cmd; diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index a8c43c9..91749dc 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -225,6 +225,7 @@ struct sdhci_ops { void (*platform_reset_enter)(struct sdhci_host *host, u8 mask); void (*platform_reset_exit)(struct sdhci_host *host, u8 mask); unsigned int (*get_f_max_clock)(struct sdhci_host *host); + void (*platform_specific_delay)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS