From: b29396@freescale.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] mmc: sdhci-esdhc-imx: fix incorrect max_discard_to for uSDHC
Date: Tue, 17 Dec 2013 16:16:28 +0800 [thread overview]
Message-ID: <1387268191-19859-3-git-send-email-b29396@freescale.com> (raw)
In-Reply-To: <1387268191-19859-1-git-send-email-b29396@freescale.com>
The default sdhci code use the 1 << 27 as the max timeout counter to
to calculate the max_discard_to, however it's not correct for uSDHC
since its the max counter is 1 << 28.
Implement esdhc_get_max_timeout to handle it correctly.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index de2655e..5d9b56d 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -880,6 +880,14 @@ static int esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned int uhs)
return esdhc_change_pinstate(host, uhs);
}
+static unsigned int esdhc_get_max_timeout_count(struct sdhci_host *host)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
+ struct pltfm_imx_data *imx_data = pltfm_host->priv;
+
+ return esdhc_is_usdhc(imx_data) ? 1 << 28 : 1 << 27;
+}
+
static struct sdhci_ops sdhci_esdhc_ops = {
.read_l = esdhc_readl_le,
.read_w = esdhc_readw_le,
@@ -892,6 +900,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
.get_ro = esdhc_pltfm_get_ro,
.platform_bus_width = esdhc_pltfm_bus_width,
.set_uhs_signaling = esdhc_set_uhs_signaling,
+ .get_max_timeout_count = esdhc_get_max_timeout_count,
};
static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
--
1.7.2.rc3
next prev parent reply other threads:[~2013-12-17 8:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-17 8:16 [PATCH v2 0/5] mmc: sdhci: a few fixes on timeout and max_discard_to Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 1/5] mmc: sdhci: add platfrom get_max_timeout_count hook Dong Aisheng
2013-12-17 8:16 ` Dong Aisheng [this message]
2013-12-17 8:16 ` [PATCH v2 3/5] mmc: sdhci: add platform set_timeout hook Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 4/5] mmc: sdhci-esdhc-imx: set the correct max timeout value for uSDHC Dong Aisheng
2013-12-17 8:16 ` [PATCH v2 5/5] mmc: sdhci: calculate max_discard_to dynamically for SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK Dong Aisheng
2013-12-17 14:30 ` [PATCH v2 0/5] mmc: sdhci: a few fixes on timeout and max_discard_to Shawn Guo
2014-01-13 10:55 ` Dong Aisheng
2014-01-20 2:42 ` Dong Aisheng
2014-01-13 13:01 ` Ulf Hansson
2014-01-15 6:53 ` Dong Aisheng
2014-05-17 14:09 ` Shawn Guo
2014-05-19 2:43 ` Dong Aisheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1387268191-19859-3-git-send-email-b29396@freescale.com \
--to=b29396@freescale.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).