From patchwork Tue Nov 30 06:13:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 354591 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 oAU6JB1n009394 for ; Tue, 30 Nov 2010 06:19:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753149Ab0K3GSy (ORCPT ); Tue, 30 Nov 2010 01:18:54 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:62573 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753456Ab0K3GSx (ORCPT ); Tue, 30 Nov 2010 01:18:53 -0500 Received: from epmmp1 (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LCO00GZ6PB0RJ20@mailout3.samsung.com> for linux-mmc@vger.kernel.org; Tue, 30 Nov 2010 15:13:48 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LCO00KT6PB0Q8@mmp1.samsung.com> for linux-mmc@vger.kernel.org; Tue, 30 Nov 2010 15:13:48 +0900 (KST) Received: from [127.0.0.1] ([10.89.53.131]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Tue, 30 Nov 2010 15:13:48 +0900 Date: Tue, 30 Nov 2010 15:13:48 +0900 From: Jaehoon Chung Subject: [RFC Patch] SDHCI: add quirk for data timeout value when card busy. To: linux-mmc@vger.kernel.org Cc: Chris Ball , kyungmin Park , Andrew Morton , matt@console-pimps.org Message-id: <4CF4961C.5020606@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=EUC-KR Content-transfer-encoding: 7BIT User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; ko; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 X-OriginalArrivalTime: 30 Nov 2010 06:13:48.0918 (UTC) FILETIME=[C0AA0960:01CB9055] 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]); Tue, 30 Nov 2010 06:19:18 +0000 (UTC) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 782c0ee..3b93d97 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -655,8 +655,12 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data) WARN_ON(host->data); - if (data == NULL) + if (data == NULL) { + if ((host->quirks & SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL) && + (host->cmd->flags & MMC_RSP_BUSY)) + sdhci_writel(host, 0xE, SDHCI_TIMEOUT_CONTROL); return; + } /* Sanity checks */ BUG_ON(data->blksz * data->blocks > 524288); diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 1fdc673..315ff49 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -83,7 +83,8 @@ struct sdhci_host { #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 (1<<28) /* Controller doesn't have HISPD bit field in HI-SPEED SD card */ #define SDHCI_QUIRK_NO_HISPD_BIT (1<<29) - +/* Controller need set data timeout value when card is busy */ +#define SDHCI_QUIRK_SET_DATA_TIMEOUT_VAL (1<<30) int irq; /* Device IRQ */ void __iomem *ioaddr; /* Mapped address */