Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5561587ybv; Tue, 11 Feb 2020 18:41:07 -0800 (PST) X-Google-Smtp-Source: APXvYqw/vr7BBL1b5grqmwYJWt3cMqieftNCAwM/wYIQZK46i1ywS4LMBaMO2j+hzSr778lAoq+6 X-Received: by 2002:a05:6808:8e1:: with SMTP id d1mr4778404oic.68.1581475266883; Tue, 11 Feb 2020 18:41:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581475266; cv=none; d=google.com; s=arc-20160816; b=0HvhpaNBxVDPF3u+Ax4pMW3aoH1YepOKJEXRCPW9x0Vy9kWnnfDPBmogLWicaIpBQ6 MW6XN3PO6D3r2IzB8j8ROMn3Sze9Btxr8Ymz/U2QVunC2BNQ3XENSxMnOELyzZCA/FOM hSM5+2r7WqEQTMO1BEcGFXe4G0ywp8jRNsFI+eWpPYKJsOMTnjLY7WKV7v7s4sCNrzk+ HkXU5V4Otp2Ow+3A9XGkchi89I6fE/GqNpGqigKzkzvDmMoIcnN9gV2NXpdHae3lsTZN yc7WAzzZrxE50BCdqaI2yYtU7ZYRnX0JROOPlA7K789mj2U8eksE3HmqJ2IeoWKYIQP3 wcbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=UaES0VUnMHke5PcnOpu3yisWe2HbAAJZCklIqX3X/10=; b=lFJhOOhkK0Op+b8L8a012Zj3H1WUYZnzz3RVNsEaenE8y17IMKnaWt92d46jHpHBmu tGTC9E3QyiyHAgy/uj/Fm8Dx3waMrYX4UTtL7dJE9gUsBlslal+TmriGykwAf7JmohNY LIw0PoHk3/Nisi0Z9VNJWgmjZB17RwgklF5iaDYrMeXRht26JF66xzFiD++QAfO2Rm9w B7wnZvTAQXcwMUo+2grS/bcJiDtU7/3ltOusA+5ceaB+//7W54f1DA3LY2cN+6Il/KIB rvWB0XSIwGEl6OR9rTkBjWsWgAsOdlBLJbGtlyXwiRmZjJU6quI8xIOFXSWI8h6RyMk9 ioIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si2481972oid.150.2020.02.11.18.40.54; Tue, 11 Feb 2020 18:41:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727696AbgBLCkU (ORCPT + 99 others); Tue, 11 Feb 2020 21:40:20 -0500 Received: from mga11.intel.com ([192.55.52.93]:42221 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727609AbgBLCkU (ORCPT ); Tue, 11 Feb 2020 21:40:20 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 18:40:20 -0800 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="226717311" Received: from unknown (HELO seokyung-mobl1) ([10.227.15.153]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 18:40:19 -0800 Date: Wed, 12 Feb 2020 11:42:20 +0900 From: Kyungmin Seo To: ulf.hansson@linaro.org, kyungmin.seo@intel.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mmc: mmc: Fix the timing for clock changing in mmc Message-ID: <20200212024220.GA32111@seokyung-mobl1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clock has to be changed after sending CMD6 for HS mode selection in mmc_hs400_to_hs200() function. The JEDEC 5.0 and 5.1 said that "High-speed" mode selection has to enable the the high speed mode timing in the Device, before chaning the clock frequency to a frequency between 26MHz and 52MHz. Signed-off-by: Kyungmin Seo --- drivers/mmc/core/mmc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 3486bc7fbb64..98640b51c73e 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1196,10 +1196,6 @@ int mmc_hs400_to_hs200(struct mmc_card *card) int err; u8 val; - /* Reduce frequency to HS */ - max_dtr = card->ext_csd.hs_max_dtr; - mmc_set_clock(host, max_dtr); - /* Switch HS400 to HS DDR */ val = EXT_CSD_TIMING_HS; err = __mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_HS_TIMING, @@ -1210,6 +1206,10 @@ int mmc_hs400_to_hs200(struct mmc_card *card) mmc_set_timing(host, MMC_TIMING_MMC_DDR52); + /* Reduce frequency to HS */ + max_dtr = card->ext_csd.hs_max_dtr; + mmc_set_clock(host, max_dtr); + err = mmc_switch_status(card); if (err) goto out_err; -- 2.17.1