From patchwork Thu Dec 2 11:26:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chuanxiao.Dong" X-Patchwork-Id: 374191 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 oB2BTkPh020177 for ; Thu, 2 Dec 2010 11:29:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932136Ab0LBL3W (ORCPT ); Thu, 2 Dec 2010 06:29:22 -0500 Received: from mga01.intel.com ([192.55.52.88]:6361 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932098Ab0LBL3V convert rfc822-to-8bit (ORCPT ); Thu, 2 Dec 2010 06:29:21 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 02 Dec 2010 03:29:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,287,1288594800"; d="scan'208,223";a="863528971" Received: from unknown (HELO intel.com) ([172.16.120.128]) by fmsmga001.fm.intel.com with ESMTP; 02 Dec 2010 03:29:20 -0800 Date: Thu, 2 Dec 2010 19:26:13 +0800 From: Chuanxiao Dong To: linux-mmc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, cjb@laptop.org, arjan@linux.intel.com, alan@linux.intel.com, akpm@linux-foundation.org, adrian.hunter@nokia.com Subject: [PATCH v3 2/3]set timeout control reg for such SDHCI host Message-ID: <20101202112613.GC10358@intel.com> Reply-To: Chuanxiao Dong MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) 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.3 (demeter1.kernel.org [140.211.167.41]); Thu, 02 Dec 2010 11:29:46 +0000 (UTC) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 9fe16c2..fbac265 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -170,6 +170,9 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) mrq->cmd->error = 0; mrq->cmd->mrq = mrq; + if (mrq->cmd->opcode != MMC_ERASE) + mrq->cmd->erase_timeout = 0; + if (mrq->data) { BUG_ON(mrq->data->blksz > host->max_blk_size); BUG_ON(mrq->data->blocks > host->max_blk_count); @@ -190,6 +193,7 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) mrq->data->stop = mrq->stop; mrq->stop->error = 0; mrq->stop->mrq = mrq; + mrq->stop->erase_timeout = 0; } } mmc_host_clk_ungate(host); diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b4448a9..de9685d 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -949,6 +949,12 @@ static void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) if (cmd->data) flags |= SDHCI_CMD_DATA; + if (host->quirks & SDHCI_QUIRK_FORCE_ERASE_SINGLE) { + /* Set the timeout to be the maximum value */ + if (cmd->erase_timeout) + sdhci_writeb(host, 0xE, SDHCI_TIMEOUT_CONTROL); + } + sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); }