Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934729AbdIYKlB (ORCPT ); Mon, 25 Sep 2017 06:41:01 -0400 Received: from mga07.intel.com ([134.134.136.100]:44970 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934336AbdIYKk7 (ORCPT ); Mon, 25 Sep 2017 06:40:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,435,1500966000"; d="scan'208";a="139080949" Subject: Re: [PATCH] mmc: core: add driver strength selection when selecting hs400es To: Chanho Min , Ulf Hansson , Shawn Lin , Linus Walleij , Uri Yanai Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Hankyung Yu , Gunho Lee References: <1506329785-12340-1-git-send-email-chanho.min@lge.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Mon, 25 Sep 2017 13:34:15 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1506329785-12340-1-git-send-email-chanho.min@lge.com> 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: 2266 Lines: 81 On 25/09/17 11:56, Chanho Min wrote: > From: "hankyung.yu" > > The drive strength setting is missed and required when selecting > hs400es. So, It is added here. > > Signed-off-by: Hankyung Yu > Signed-off-by: Chanho Min 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. >