Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1233009imm; Fri, 22 Jun 2018 12:43:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKLp5eRm/lf3aIkqCD/AkRXtKBO7FFi8sxiMJOX6wJ0FF16t0M4WD0eg8Dc31XeJcvMXL1z X-Received: by 2002:a63:5401:: with SMTP id i1-v6mr2510978pgb.187.1529696607332; Fri, 22 Jun 2018 12:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529696607; cv=none; d=google.com; s=arc-20160816; b=qkTHduxobGgRVsykEyADbcVxHwjAOSKsnwQs+BAFO54oHjOZxgP9Ql4gosN+OBbgTv gb/yQjhRxolD+B3QBMW0FsLkInTCWDoIr644oQXVEvE/qjuHEofadEA2HyCM2o9H45pC QE59NIy8afq02YRZZ/ZyPBR+bFHQBrtJ31z/ZM1fc4BoqwCP2m+mYPclSTWy7XwsyPoY OFU+eJlvDOE+yllwLTCrf9AAuKobGHEBItzk4sfNzOgrMg4CSlvy0F13iUl5qY+KC2Wf DsAzRNVz9+nRQFkzLYCqOELyF5NhKUgTRypDNRnUreFNqjUT4Ui6Cdd+DGeA892BcneN c3qA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=JX04q5sKt23PMzPS8XNczE07/3cN7wZIKo3zQyDFIhs=; b=payFhCb0zEZ9lKoUFu/XoQHymqM3i+9BAagXLAzTekhYxZOlJYYV906meRMAhysvvh r8RnPBwcr4vbBJEjLhV+C23RGsL0sAPIh/YSNradS3tdCnapXddJiylDfBmlMJDl2Xag 5OGZVQS0Cv0KaMJkapNLPj1uFBO7pS4Kzg9uCT6PmO84WHoSky5JQpAB1eguyB3jGGuA k/1COraoBDyFErvaBolwVWpBHCz2WhgdhnsrKSPH3AgcwAedcHCX/8LUI6Dw58Tte3K/ hFIigCvma8YJGGKwJGtikkWrVUMT9dvxfLPdYa4PG6/LBcElaE5u91ZUAIlhYZ9fuaxW rZ7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w5-v6si7653323plz.438.2018.06.22.12.42.59; Fri, 22 Jun 2018 12:43:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934352AbeFVTl5 (ORCPT + 99 others); Fri, 22 Jun 2018 15:41:57 -0400 Received: from mga14.intel.com ([192.55.52.115]:60673 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934096AbeFVTl4 (ORCPT ); Fri, 22 Jun 2018 15:41:56 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 12:41:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,258,1526367600"; d="scan'208";a="49173058" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.168]) ([10.237.72.168]) by fmsmga007.fm.intel.com with ESMTP; 22 Jun 2018 12:41:39 -0700 Subject: Re: [PATCH V2 5/7] mmc: sdhci: add CMD23 support for v4 mode To: Chunyan Zhang , Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Orson Zhai , Baolin Wang , Billows Wu , zhang.lyra@gmail.com References: <1529028255-6022-1-git-send-email-zhang.chunyan@linaro.org> <1529028255-6022-6-git-send-email-zhang.chunyan@linaro.org> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <2c91af23-da14-ed70-91b3-d7bfb06f3141@intel.com> Date: Fri, 22 Jun 2018 22:40:14 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <1529028255-6022-6-git-send-email-zhang.chunyan@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/15/2018 05:04 AM, Chunyan Zhang wrote: > Host Driver Version 4.10 adds a new bit in Host Control 2 Register > for selecting Auto CMD23 or Auto CMD12 for ADMA3 data transfer. We don't support ADMA3. It would require changes to the block driver. So is this change needed? > > Signed-off-by: Chunyan Zhang > --- > drivers/mmc/host/sdhci.c | 16 +++++++++++++++- > drivers/mmc/host/sdhci.h | 1 + > 2 files changed, 16 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index b8ee124..3b2af7e 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -954,6 +954,20 @@ static inline bool sdhci_auto_cmd12(struct sdhci_host *host, > !mrq->cap_cmd_during_tfr; > } > > +static inline void sdhci_set_auto_cmd23(struct sdhci_host *host, > + struct mmc_command *cmd) > +{ > + u16 ctrl2; > + > + if (host->v4_mode) { Isn't this only for a V4.1 controller, and doesn't the mode have to be "Auto Cmd Auto Select"? > + ctrl2 = sdhci_readw(host, SDHCI_HOST_CONTROL2); > + ctrl2 |= SDHCI_CMD23_ENABLE; > + sdhci_writew(host, ctrl2, SDHCI_HOST_CONTROL2); > + } else { > + sdhci_writel(host, cmd->mrq->sbc->arg, SDHCI_ARGUMENT2); > + } > +} > + > static void sdhci_set_transfer_mode(struct sdhci_host *host, > struct mmc_command *cmd) > { > @@ -989,7 +1003,7 @@ static void sdhci_set_transfer_mode(struct sdhci_host *host, > mode |= SDHCI_TRNS_AUTO_CMD12; > else if (cmd->mrq->sbc && (host->flags & SDHCI_AUTO_CMD23)) { > mode |= SDHCI_TRNS_AUTO_CMD23; > - sdhci_writel(host, cmd->mrq->sbc->arg, SDHCI_ARGUMENT2); > + sdhci_set_auto_cmd23(host, cmd); > } > } > > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index 1e84539..d5e1c10 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -185,6 +185,7 @@ > #define SDHCI_CTRL_DRV_TYPE_D 0x0030 > #define SDHCI_CTRL_EXEC_TUNING 0x0040 > #define SDHCI_CTRL_TUNED_CLK 0x0080 > +#define SDHCI_CMD23_ENABLE 0x0800 > #define SDHCI_CTRL_V4_MODE 0x1000 > #define SDHCI_CTRL_64BIT_ADDR 0x2000 > #define SDHCI_CTRL_PRESET_VAL_ENABLE 0x8000 >