linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haibo Chen <haibo.chen@freescale.com>
To: ulf.hansson@linaro.org, aisheng.dong@freescale.com
Cc: haibo.chen@freescale.com, linux-mmc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] mmc: sdhci-esdhc-imx: move the setting of watermark level out of probe
Date: Tue, 10 Nov 2015 17:43:29 +0800	[thread overview]
Message-ID: <1447148610-2770-1-git-send-email-haibo.chen@freescale.com> (raw)

Currently, we config the watermark_level register only in probe.
This will cause the mmc write operation timeout issue after system
resume back in LPSR mode. Because in LPSR mode, after system resume
back, the watermark_level register(0x44) changes to 0x08000880, which
set the write watermark level as 0, and set the read watermark level
as 128. This value is incorrect.

This patch move the setting of watermark level register out of probe,
so after system resume back, mmc driver can set this watermark level
register back to 0x10401040.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
---
 drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 1f1582f..1508949 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -584,6 +584,14 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg)
 		mask = 0xffff & ~(ESDHC_CTRL_BUSWIDTH_MASK | ESDHC_CTRL_D3CD);
 
 		esdhc_clrset_le(host, mask, new_val, reg);
+
+		/*
+		 * The imx6q/imx7d ROM code will change the default watermark
+		 * level setting to something insane.  Change it back here.
+		 */
+		 if (esdhc_is_usdhc(imx_data))
+			 writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL);
+
 		return;
 	}
 	esdhc_clrset_le(host, 0xff, val, reg);
@@ -1155,13 +1163,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
 		host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK
 			| SDHCI_QUIRK_BROKEN_ADMA;
 
-	/*
-	 * The imx6q ROM code will change the default watermark level setting
-	 * to something insane.  Change it back here.
-	 */
 	if (esdhc_is_usdhc(imx_data)) {
-		writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL);
-
 		host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN;
 		host->mmc->caps |= MMC_CAP_1_8V_DDR;
 
-- 
1.9.1

             reply	other threads:[~2015-11-10  9:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10  9:43 Haibo Chen [this message]
2015-11-10  9:43 ` [PATCH 2/2] mmc: sdhci-esdhc-imx: correct the tuning-step setting Haibo Chen
2015-11-19 11:20   ` Ulf Hansson
2015-11-19 16:34     ` Dong Aisheng
2015-11-20 15:23       ` Ulf Hansson
2015-11-19 11:17 ` [PATCH 1/2] mmc: sdhci-esdhc-imx: move the setting of watermark level out of probe Ulf Hansson
2015-11-19 16:29   ` 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=1447148610-2770-1-git-send-email-haibo.chen@freescale.com \
    --to=haibo.chen@freescale.com \
    --cc=aisheng.dong@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ulf.hansson@linaro.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).