From patchwork Thu Dec 27 11:20:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 10743655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 189D2746 for ; Thu, 27 Dec 2018 11:20:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0662128746 for ; Thu, 27 Dec 2018 11:20:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED3F028977; Thu, 27 Dec 2018 11:20:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C19628746 for ; Thu, 27 Dec 2018 11:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728120AbeL0LU2 (ORCPT ); Thu, 27 Dec 2018 06:20:28 -0500 Received: from mail-eopbgr10046.outbound.protection.outlook.com ([40.107.1.46]:30170 "EHLO EUR02-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727858AbeL0LU2 (ORCPT ); Thu, 27 Dec 2018 06:20:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aPIbqsNytCt4LoTEI3ElGmrcu42bxgyx1nEkFw8PqqE=; b=ur1o3qWA3+d8Nlv59GRftehjmBQ5yfo//yPfdK/dbenmBptoG24+E7rOxPMWxbezrTs5FLnCyZcFgxUpH5qRKro3ltiU0kv/IO3/vLQxnrCgiq1AoVsFSncfMg7rfNjfb3oGk94NdFQKOjDEN3kckLuSYPaCc4anB/o0EdrNrLI= Received: from VI1PR04MB5040.eurprd04.prod.outlook.com (20.177.50.97) by VI1PR04MB5760.eurprd04.prod.outlook.com (20.178.127.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.21; Thu, 27 Dec 2018 11:20:25 +0000 Received: from VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::cd3d:ce97:132b:7148]) by VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::cd3d:ce97:132b:7148%3]) with mapi id 15.20.1471.019; Thu, 27 Dec 2018 11:20:25 +0000 From: BOUGH CHEN To: "adrian.hunter@intel.com" , "ulf.hansson@linaro.org" CC: "linux-mmc@vger.kernel.org" , dl-linux-imx , "stable@vger.kernel.org" Subject: [PATCH] mmc: sdhci-esdhc-imx: fix HS400 timing issue Thread-Topic: [PATCH] mmc: sdhci-esdhc-imx: fix HS400 timing issue Thread-Index: AQHUndYpbsdVR12rHkiSLhz99TEBlA== Date: Thu, 27 Dec 2018 11:20:24 +0000 Message-ID: <20181227112750.446-1-haibo.chen@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: HK2PR02CA0211.apcprd02.prod.outlook.com (2603:1096:201:20::23) To VI1PR04MB5040.eurprd04.prod.outlook.com (2603:10a6:803:59::33) authentication-results: spf=none (sender IP is ) smtp.mailfrom=haibo.chen@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [92.121.68.129] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR04MB5760;6:x9pSZ437LSbUp+RpuJMFx0Sdskz8fslnQd/AxLgbkQqglLVl846y3nJmNePgFPFRV70u5Mfg791mnRzK7z80/CXqfKkBE/t1U5WjHCwaSx4BqR8TxNPpAsgCJF6pZ9/lNPqsLYjLxtcJwsauft+Fe4soL06tv35wtp6O7/vSrh3dK1QlMWLXSe9bz5rXKq9lMPtFucYQL8YV4UO3WJAmdtMKJz7IUVQr+mEuwMtmp09QlJ/WfJV7PQJV8EAqpNWaUA3Ps19kxFOKHSLRXo6fiOB5w4t0ZNukzHw5iTEeFBUTuh0pdQp2nTPQYj3+wMnjXar3xAqKP5EJThMjaXVnWs2hZbnDJYv5Q3lmMN9JdZ1H/4/bxl8Iacg5SoEfS9Vk8h/67fjmbZfNZ0eNaTxL3G2ES2TkZfAgM01U73eq7XwtRwaYcC0xp7O5WiXFLnmJBuWU1Rmr7ELhQc/K081vMA==;5:bxMogUmIrLJUOyY8IxFiZucQHdCQOVuTQ/m3YCLwFUc7Qz4mK1GznnW/jCqElSAPnLlewZKR17jMDCaCC0ifpiBUYHOTbykSL8Fw24onCOyvvD65oEqqR545PqwWE1Pk/eQoBPMxMhoKmWznA0Bj8AU98W4afk3+ncgpMN4VJUQ=;7:RhA+hgwkOpBAZO7M/BqKofjKOxOiiHFX4NfJBvtw5dGZgeyoIuLefDo82rXmdQYS9nzhflvIeDdCR/ZMFJyqOYhRJLyhCXebf9Dgr/fJEU86yFQl1FubCjMtojF6ld0monclUJJ6G2ceep0AlYivdw== x-ms-office365-filtering-correlation-id: 547cc19f-9185-42b5-f9b8-08d66bed4bbf x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB5760; x-ms-traffictypediagnostic: VI1PR04MB5760: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(93006095)(93001095)(3002001)(3231475)(944501520)(52105112)(10201501046)(6055026)(6041310)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:VI1PR04MB5760;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB5760; x-forefront-prvs: 0899B47777 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(366004)(376002)(39860400002)(346002)(396003)(136003)(199004)(189003)(6486002)(50226002)(2501003)(316002)(99286004)(14454004)(36756003)(66066001)(71190400001)(71200400001)(6512007)(54906003)(110136005)(3846002)(6116002)(6506007)(386003)(26005)(97736004)(53936002)(102836004)(8676002)(52116002)(1076003)(476003)(478600001)(2616005)(81166006)(81156014)(7736002)(305945005)(105586002)(53346004)(2906002)(486006)(256004)(25786009)(8936002)(186003)(106356001)(4326008)(5660300001)(68736007)(6436002)(86362001)(575784001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB5760;H:VI1PR04MB5040.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: KLV2Fwh5uvP3g+uhjNzlmmEsIkV5YZQfZPG+6vBPvtpG/ZNRpiPBOiZU6V2Es0E9zyebTGPHcwGMSgPLBF3IMPCm4ogYeXAxBd/UTabGJkyL7gjZ+ypcftYbSo5V5Xej0uytVw+cp6YqM5M4sS9wKBZ2LZqE1p9EXz1HVq59XTWWbyfm8UV6QV6drWcAYIJL+N/Lv//cHSklgC+nZPdZGtIbUueVCzlrvqTG6tjjVfMnPIY1+iekigBpvuzpaZkJyVZAebmTxZIw6SbYw1tuLnyCTW8mksDLVUuFN8SSN2gchtf8LhsBNsaNX0+As+SD spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 547cc19f-9185-42b5-f9b8-08d66bed4bbf X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Dec 2018 11:20:24.9262 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5760 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now tuning reset will be done when the timing is MMC_TIMING_LEGACY/ MMC_TIMING_MMC_HS/MMC_TIMING_SD_HS. But for timing MMC_TIMING_MMC_HS, we can not do tuning reset, otherwise HS400 timing is not right. Here is the process of init HS400, first finish tuning in HS200 mode, then switch to HS mode and 8 bit DDR mode, finally switch to HS400 mode. If we do tuning reset in HS mode, this will cause HS400 mode lost the tuning setting, which will cause CRC error. This fix commit d9370424c948 ("mmc: sdhci-esdhc-imx: reset tuning circuit when power on mmc card"). Signed-off-by: Haibo Chen Cc: stable@vger.kernel.org # v4.12+ Acked-by: Adrian Hunter --- drivers/mmc/host/sdhci-esdhc-imx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index d0d319398a54..984cc1a788cb 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -979,6 +979,7 @@ static void esdhc_set_uhs_signaling(struct sdhci_host *host, unsigned timing) case MMC_TIMING_UHS_SDR25: case MMC_TIMING_UHS_SDR50: case MMC_TIMING_UHS_SDR104: + case MMC_TIMING_MMC_HS: case MMC_TIMING_MMC_HS200: writel(m, host->ioaddr + ESDHC_MIX_CTRL); break;