From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756779AbcIVJik (ORCPT ); Thu, 22 Sep 2016 05:38:40 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38326 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbcIVJii (ORCPT ); Thu, 22 Sep 2016 05:38:38 -0400 MIME-Version: 1.0 In-Reply-To: <1474422233-29355-4-git-send-email-shawn.lin@rock-chips.com> References: <1474422233-29355-1-git-send-email-shawn.lin@rock-chips.com> <1474422233-29355-4-git-send-email-shawn.lin@rock-chips.com> From: Ulf Hansson Date: Thu, 22 Sep 2016 11:38:35 +0200 Message-ID: Subject: Re: [PATCH 3/5] mmc: core: changes frequency to hs_max_dtr when selecting hs400es To: Shawn Lin Cc: Adrian Hunter , Jaehoon Chung , linux-mmc , "linux-kernel@vger.kernel.org" , "open list:ARM/Rockchip SoC..." Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21 September 2016 at 03:43, Shawn Lin wrote: > Per JESD84-B51 P69, Host need to change frequency to <=52MHz after > setting HS_TIMING to 0x1, and host may changes frequency to <= 200MHz > after setting HS_TIMING to 0x3. It seems there is no difference if > we don't change frequency to <= 52MHz as f_init is already less than > 52MHz. But actually it does make difference. When doing compatibility > test we see failures for some eMMC devices without changing the > frequency to hs_max_dtr. And let's read the spec again, we could see > that "Host may changes frequency to 200MHz" implies that it's not > mandatory. But the "Host need to change frequency to <= 52MHz" implies > that we should do this. I don't get this. Are you saying that f_init > 52 MHz? That should not be impossible, right!? So either the core has changed the clock rate by mistake at some other execution path, or the host driver didn't set the correct clock rate the first time when invoked via mmc_power_up()? Kind regards Uffe > > Reported-by: Xiao Yao > Signed-off-by: Shawn Lin > --- > > drivers/mmc/core/mmc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c > index 3163bb9..989d37e 100644 > --- a/drivers/mmc/core/mmc.c > +++ b/drivers/mmc/core/mmc.c > @@ -1282,6 +1282,8 @@ static int mmc_select_hs400es(struct mmc_card *card) > if (err) > goto out_err; > > + mmc_set_clock(host, card->ext_csd.hs_max_dtr); > + > err = mmc_switch_status(card); > if (err) > goto out_err; > -- > 2.3.7 > >