Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970782AbdI0B2i (ORCPT ); Tue, 26 Sep 2017 21:28:38 -0400 Received: from lucky1.263xmail.com ([211.157.147.134]:56267 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934797AbdI0B2f (ORCPT ); Tue, 26 Sep 2017 21:28:35 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: stable@vger.kernel.org X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <22aae1a43ae32c371234b3129c7f238d> X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Cc: Ulf Hansson , Linus Walleij , shawn.lin@rock-chips.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Hankyung Yu , Gunho Lee , stable@vger.kernel.org Subject: Re: [PATCH v2] mmc: core: add driver strength selection when selecting hs400es To: Chanho Min , Adrian Hunter , Uri Yanai References: <1506384220-5108-1-git-send-email-chanho.min@lge.com> From: Shawn Lin Message-ID: <9ac955f6-2657-c9d5-a515-105ca33ec62d@rock-chips.com> Date: Wed, 27 Sep 2017 09:28:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1506384220-5108-1-git-send-email-chanho.min@lge.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2484 Lines: 83 On 2017/9/26 8:03, Chanho Min wrote: > The driver strength selection is missed and required when selecting > hs400es. So, It is added here. > > v2: add stable tag. > > Fixes: 81ac2af65793ecf ("mmc: core: implement enhanced strobe support") > Cc: stable@vger.kernel.org > Signed-off-by: Hankyung Yu > Signed-off-by: Chanho Min > Reviewed-by: Adrian Hunter > --- Should move changelog out of commit msg and use 12bit SHA-1 ID. Reviewed-by: Shawn Lin > 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 a7eb623..36217ad 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -1286,6 +1286,23 @@ int mmc_hs400_to_hs200(struct mmc_card *card) > 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; > @@ -1341,6 +1358,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; > @@ -1374,23 +1393,6 @@ static int mmc_select_hs400es(struct mmc_card *card) > 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. >