All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Rakity <prakity@nvidia.com>
To: Giuseppe CAVALLARO <peppe.cavallaro@st.com>
Cc: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"cjb@laptop.org" <cjb@laptop.org>
Subject: Re: [PATCH (v2)] mmc: sdhci: fix caps2 for HS200
Date: Thu, 13 Jun 2013 10:59:42 +0200	[thread overview]
Message-ID: <3FCC5537-AABE-4E12-89D7-70D3B9E8F482@nvidia.com> (raw)
In-Reply-To: <1371017798-4144-1-git-send-email-peppe.cavallaro@st.com>


On Jun 12, 2013, at 7:16 AM, Giuseppe CAVALLARO <peppe.cavallaro@st.com> wrote:

> Although the HC supports HS200 (eMMC) the caps2 are always zero; this means that
> no way to use the super speed mode (when init the card).
> 
> If the HC support SDR104, for SD3.0, so it also supports HS200 for eMMC and
> this patch just sets the MMC_CAP2_HS200 in the host caps2 field.
> 
> v2: Since SDR104 and HS200 are effectively the same thing the patch deletes
> the defines for HS200 and use SDR104.
> 
> Reported-by: Youssef Triki <youssef.triki@st.com>
> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
> Cc: Philip Rakity <prakity@nvidia.com>
> ---
> drivers/mmc/host/sdhci.c  |   14 +++++++++-----
> include/linux/mmc/sdhci.h |    2 +-
> 2 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 2ea429c..b8bb3b3 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -1846,7 +1846,7 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
> 	 */
> 	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR50) &&
> 	    (host->flags & SDHCI_SDR50_NEEDS_TUNING ||
> -	     host->flags & SDHCI_HS200_NEEDS_TUNING))
> +	     host->flags & SDHCI_SDR104_NEEDS_TUNING))
> 		requires_tuning_nonuhs = true;
> 
> 	if (((ctrl & SDHCI_CTRL_UHS_MASK) == SDHCI_CTRL_UHS_SDR104) ||
> @@ -2962,9 +2962,13 @@ int sdhci_add_host(struct sdhci_host *host)
> 		mmc->caps |= MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25;
> 
> 	/* SDR104 supports also implies SDR50 support */
> -	if (caps[1] & SDHCI_SUPPORT_SDR104)
> +	if (caps[1] & SDHCI_SUPPORT_SDR104) {
> 		mmc->caps |= MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50;
> -	else if (caps[1] & SDHCI_SUPPORT_SDR50)
> +		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
> +		 * field can be promoted to support HS200.
> +		 */
> +		mmc->caps2 |= MMC_CAP2_HS200;
> +	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
> 		mmc->caps |= MMC_CAP_UHS_SDR50;
> 
> 	if (caps[1] & SDHCI_SUPPORT_DDR50)
> @@ -2974,9 +2978,9 @@ int sdhci_add_host(struct sdhci_host *host)
> 	if (caps[1] & SDHCI_USE_SDR50_TUNING)
> 		host->flags |= SDHCI_SDR50_NEEDS_TUNING;
> 
> -	/* Does the host need tuning for HS200? */
> +	/* Does the host need tuning for SDR104 / HS200? */
> 	if (mmc->caps2 & MMC_CAP2_HS200)
> -		host->flags |= SDHCI_HS200_NEEDS_TUNING;
> +		host->flags |= SDHCI_SDR104_NEEDS_TUNING;
> 
> 	/* Driver Type(s) (A, C, D) supported by the host */
> 	if (caps[1] & SDHCI_DRIVER_TYPE_A)
> diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
> index b838ffc..0b1d7f4 100644
> --- a/include/linux/mmc/sdhci.h
> +++ b/include/linux/mmc/sdhci.h
> @@ -126,7 +126,7 @@ struct sdhci_host {
> #define SDHCI_AUTO_CMD23	(1<<7)	/* Auto CMD23 support */
> #define SDHCI_PV_ENABLED	(1<<8)	/* Preset value enabled */
> #define SDHCI_SDIO_IRQ_ENABLED	(1<<9)	/* SDIO irq enabled */
> -#define SDHCI_HS200_NEEDS_TUNING (1<<10)	/* HS200 needs tuning */
> +#define SDHCI_SDR104_NEEDS_TUNING (1<<10)	/* SDR104/HS200 needs tuning */
> #define SDHCI_USING_RETUNING_TIMER (1<<11)	/* Host is using a retuning timer for the card */
> 
> 	unsigned int version;	/* SDHCI spec. version */
> -- 
> 1.7.4.4
> 

Reviewed-by: Philip Rakity <prakity@nvidia.com>

note:  cannot test code at this time.


  reply	other threads:[~2013-06-13  8:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 14:09 [PATCH] mmc: sdhci: fix caps2 for HS200 Giuseppe CAVALLARO
2013-06-11 15:09 ` Philip Rakity
2013-06-12  6:16   ` [PATCH (v2)] " Giuseppe CAVALLARO
2013-06-13  8:59     ` Philip Rakity [this message]
2013-06-18  2:32     ` Shen, Jackey
2013-06-20  8:56       ` Giuseppe CAVALLARO
2013-06-20  9:16         ` Youssef TRIKI
2013-06-22  8:33           ` Shen, Jackey
2013-06-23  7:52             ` Giuseppe CAVALLARO
2013-06-27 15:50     ` Chris Ball

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=3FCC5537-AABE-4E12-89D7-70D3B9E8F482@nvidia.com \
    --to=prakity@nvidia.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=peppe.cavallaro@st.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.