mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Chanho Min <chanho.min@lge.com>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Uri Yanai <uri.yanai@sandisk.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hankyung Yu <hankyung.yu@lge.com>, Gunho Lee <gunho.lee@lge.com>
Subject: Re: [PATCH] mmc: core: add driver strength selection when selecting hs400es
Date: Mon, 25 Sep 2017 13:34:15 +0300	[thread overview]
Message-ID: <fe5fae84-e860-716d-16f7-e77bcae859f8@intel.com> (raw)
In-Reply-To: <1506329785-12340-1-git-send-email-chanho.min@lge.com>

On 25/09/17 11:56, Chanho Min wrote:
> From: "hankyung.yu" <hankyung.yu@lge.com>
> 
> The drive strength setting is missed and required when selecting
> hs400es. So, It is added here.
> 
> Signed-off-by: Hankyung Yu <hankyung.yu@lge.com>
> Signed-off-by: Chanho Min <chanho.min@lge.com>

Looks right.  I guess we should add:

Fixes: 81ac2af65793ecf ("mmc: core: implement enhanced strobe support")
Cc: stable@vger.kernel.org


> ---
>  drivers/mmc/core/mmc.c | 36 +++++++++++++++++++-----------------
>  1 file changed, 19 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 07516f3..bc7586c 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -1249,6 +1249,23 @@ out_err:
>  	return err;
>  }
>  
> +static void mmc_select_driver_type(struct mmc_card *card)
> +{
> +	int card_drv_type, drive_strength, drv_type;
> +
> +	card_drv_type = card->ext_csd.raw_driver_strength |
> +			mmc_driver_type_mask(0);
> +
> +	drive_strength = mmc_select_drive_strength(card,
> +						   card->ext_csd.hs200_max_dtr,
> +						   card_drv_type, &drv_type);
> +
> +	card->drive_strength = drive_strength;
> +
> +	if (drv_type)
> +		mmc_set_driver_type(card->host, drv_type);
> +}
> +
>  static int mmc_select_hs400es(struct mmc_card *card)
>  {
>  	struct mmc_host *host = card->host;
> @@ -1300,6 +1317,8 @@ static int mmc_select_hs400es(struct mmc_card *card)
>  		goto out_err;
>  	}
>  
> +	mmc_select_driver_type(card);
> +
>  	/* Switch card to HS400 */
>  	val = EXT_CSD_TIMING_HS400 |
>  	      card->drive_strength << EXT_CSD_DRV_STR_SHIFT;
> @@ -1333,23 +1352,6 @@ out_err:
>  	return err;
>  }
>  
> -static void mmc_select_driver_type(struct mmc_card *card)
> -{
> -	int card_drv_type, drive_strength, drv_type;
> -
> -	card_drv_type = card->ext_csd.raw_driver_strength |
> -			mmc_driver_type_mask(0);
> -
> -	drive_strength = mmc_select_drive_strength(card,
> -						   card->ext_csd.hs200_max_dtr,
> -						   card_drv_type, &drv_type);
> -
> -	card->drive_strength = drive_strength;
> -
> -	if (drv_type)
> -		mmc_set_driver_type(card->host, drv_type);
> -}
> -
>  /*
>   * For device supporting HS200 mode, the following sequence
>   * should be done before executing the tuning process.
> 

      reply	other threads:[~2017-09-25 10:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25  8:56 Chanho Min
2017-09-25 10:34 ` Adrian Hunter [this message]

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=fe5fae84-e860-716d-16f7-e77bcae859f8@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=chanho.min@lge.com \
    --cc=gunho.lee@lge.com \
    --cc=hankyung.yu@lge.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.org \
    --cc=uri.yanai@sandisk.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

Powered by JetHome