Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934090AbdLSIho (ORCPT ); Tue, 19 Dec 2017 03:37:44 -0500 Received: from mga09.intel.com ([134.134.136.24]:43715 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933552AbdLSIhk (ORCPT ); Tue, 19 Dec 2017 03:37:40 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,425,1508828400"; d="scan'208";a="13521484" Subject: Re: [PATCH 3/3] mmc: sdhci: Modify sdhci o2 quirk for eMMC HS200 tuning case To: LinuxPatchCommit , "ulf.hansson@linaro.org" , "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" Cc: "Shirley Her (SC)" References: From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <381dcaa4-49ed-9145-58bf-4e28ba077041@intel.com> Date: Tue, 19 Dec 2017 10:37:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1455 Lines: 33 On 04/12/17 12:10, LinuxPatchCommit wrote: > Dear all, > > Don't clear transfer mode register in sdhci_set_transfer_mode(). > > In sdhci_set_transfer_mode(), clear transfer mode quirk2 will clear SD host transfer mode register for non-data commands. This quirk is used for the bug of O2micro/Bayhubtech devices. In eMMC HS200 tuning case, the tuning process uses hardware tuning and it needs to set transfer mode register for tuning command. > > Signed-off-by: ernest.zhang > --- > 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); In the HS200 case you are sending the tuning command with data, so I do not understand why you need this i.e. you will never get here > } else { > /* clear Auto CMD settings for no data CMDs */ > mode = sdhci_readw(host, SDHCI_TRANSFER_MODE); > -- > 2.14.1 >