public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: "ernest.zhang" <ernest.zhang@bayhubtech.com>
To: adrian.hunter@intel.com, ulf.hansson@linaro.org,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: yuxiang.wan@bayhubtech.com, xiaoguang.yu@bayhubtech.com,
	shirley.her@bayhubtech.com
Subject: [PATCH 1/3] mmc: sdhci: fix SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD handling
Date: Thu, 28 Dec 2017 17:59:13 +0800	[thread overview]
Message-ID: <20171228095913.3944-1-ernest.zhang@bayhubtech.com> (raw)

SD controller with SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD quirk
will clear SD host transfer mode register for non-data commands. But in
eMMC HS200 hardware tuning case, the hardware tuning process need to
transfer mode register has properly value. So don't clear transfer
mode register when opcode equals to MMC_SEND_TUNING_BLOCK_HS200.

Signed-off-by: ernest.zhang <ernest.zhang@bayhubtech.com>
---
 drivers/mmc/host/sdhci.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 0d5fcca18c9e..d5b19fc9ea56 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -918,7 +918,9 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host,
 	if (data == NULL) {
 		if (host->quirks2 &
 			SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD) {
-			sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
+			/* cannot clear transfer mode register when tuning */
+			if (cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
+				sdhci_writew(host, 0x0, SDHCI_TRANSFER_MODE);
 		} else {
 		/* clear Auto CMD settings for no data CMDs */
 			mode = sdhci_readw(host, SDHCI_TRANSFER_MODE);
-- 
2.14.1

             reply	other threads:[~2017-12-28  9:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28  9:59 ernest.zhang [this message]
2018-01-09 12:34 ` [PATCH 1/3] mmc: sdhci: fix SDHCI_QUIRK2_CLEAR_TRANSFERMODE_REG_BEFORE_CMD handling Adrian Hunter

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=20171228095913.3944-1-ernest.zhang@bayhubtech.com \
    --to=ernest.zhang@bayhubtech.com \
    --cc=adrian.hunter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shirley.her@bayhubtech.com \
    --cc=ulf.hansson@linaro.org \
    --cc=xiaoguang.yu@bayhubtech.com \
    --cc=yuxiang.wan@bayhubtech.com \
    /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