From patchwork Thu Feb 28 10:15:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bough Chen X-Patchwork-Id: 10832735 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 2704C1805 for ; Thu, 28 Feb 2019 10:15:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1444F2DD3B for ; Thu, 28 Feb 2019 10:15:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 07D3F2E5A2; Thu, 28 Feb 2019 10:15:51 +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 617092DD3B for ; Thu, 28 Feb 2019 10:15:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732293AbfB1KPt (ORCPT ); Thu, 28 Feb 2019 05:15:49 -0500 Received: from mail-eopbgr70083.outbound.protection.outlook.com ([40.107.7.83]:35075 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732211AbfB1KPt (ORCPT ); Thu, 28 Feb 2019 05:15:49 -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=XUGHhFs8KCmRXClcXA/F71oRDLF86UYXnLaCAcF/EjU=; b=G6L3PkWInqHWPo0Vb4nicAab5gQ+zJiHlH7GSjjsgVwPXAfmTO7eOUFSSXn9ZKq05BobNkYkFjEraQgY55AyayPeCUpru5MVvhXwwjYRGghTUmkMn+z64pDCysWi0lt/trtQujfgUzUo35UpWcDf1HsugUJW9mVm/blYXW6Hyto= Received: from VI1PR04MB5040.eurprd04.prod.outlook.com (20.177.50.97) by VI1PR04MB4815.eurprd04.prod.outlook.com (20.177.48.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1643.16; Thu, 28 Feb 2019 10:15:42 +0000 Received: from VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::6c6c:b113:a6c1:dcb4]) by VI1PR04MB5040.eurprd04.prod.outlook.com ([fe80::6c6c:b113:a6c1:dcb4%5]) with mapi id 15.20.1643.022; Thu, 28 Feb 2019 10:15:42 +0000 From: BOUGH CHEN To: "adrian.hunter@intel.com" , "ulf.hansson@linaro.org" , Aisheng Dong CC: "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , "linux-mmc@vger.kernel.org" , "stable@vger.kernel.org" , BOUGH CHEN Subject: [PATCH v2] mmc: sdhci-esdhc-imx: correct the fix of ERR004536 Thread-Topic: [PATCH v2] mmc: sdhci-esdhc-imx: correct the fix of ERR004536 Thread-Index: AQHUz06PIRX34pVw50ObUeBCqJep7w== Date: Thu, 28 Feb 2019 10:15:42 +0000 Message-ID: <20190228102004.9695-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: HK0P153CA0005.APCP153.PROD.OUTLOOK.COM (2603:1096:203:18::17) 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: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 73923c5c-4de2-41f7-81fa-08d69d65b20d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020);SRVR:VI1PR04MB4815; x-ms-traffictypediagnostic: VI1PR04MB4815: x-microsoft-exchange-diagnostics: =?iso-8859-1?q?1=3BVI1PR04MB4815=3B23=3AhC?= =?iso-8859-1?q?GW2UiMjQ80z9A7G1MH/Zs/ixmuT6qI0HRICP5rc7ypILngAZhAnG133up/0q?= =?iso-8859-1?q?/e2a4n/T1sE1A42gGgUQF7bGdzr8+n92JQspfPbegjGDnCC4+PVbs33+UGyM?= =?iso-8859-1?q?gd3xlCNHQBsavPmDJ/jPWr2qA9ERljnmsgjjCc7wczIU6yYD5yOOsC1HbMjo?= =?iso-8859-1?q?FahATvUklbKwsXrJYUPWhaZSBGe/WyRNJr2TAdxXetLPcfewubeutkcILNMV?= =?iso-8859-1?q?SmDFaESfbhix651bBwY100789iepc33TERHGQJtRlm5eWbiwVTCBWxXTjw/u?= =?iso-8859-1?q?F4/AcH0ZVSmGR3qs4NyCyp3NdealcOoeOAD6Bqku1/SyjnWT3XOuJqikJ5Hn?= =?iso-8859-1?q?WnSFRpD7ut2TzVcPyyEayI40b9dFnf72a043iy1pHu5KLZvDc9iLaEC7Et8a?= =?iso-8859-1?q?86Y/7SPx/E0XD2YsIY9a7GNF5og6DkHrFVwxNLW002dl6U5zIYFZbfyB+kal?= =?iso-8859-1?q?3TGhCqvzj/B7bo6T2uFXxunJhsT1v4jdfohDu44orw9jogfzCSLTLj65/0nA?= =?iso-8859-1?q?qeC9g9T+SP8oq72nM+4YmfjNVLVuKcN10qecg6mhnaET7bkabBqgTvW2it3N?= =?iso-8859-1?q?VMFtfDL9szbJbA3Fc96unaUPx0Y/ucgdaAeSAjKigdAmNB/fiYqNDud+qupp?= =?iso-8859-1?q?fUU6Y3IjRbRQNwZmu68zwG+1IgbLocwZHIPUwpMpKm99XLkwCJV4cOJ+MAPv?= =?iso-8859-1?q?4xE1zezDIxkZXn1TbZG5A6CLiIPyiYehWar5MwIoK3JNRyexmo/nNuPrhBrC?= =?iso-8859-1?q?lzDxPq9lmVMU+CAE1l5PpcFa4eFzNnX0KLn2dbMLFl3aA38YNeV+M/c0kcw9?= =?iso-8859-1?q?v3mvUp4TCmo6YQqd7zxUz6fxjFevy3rYSq2hjYS4nZkrbbzzKnw7vlqUIDcr?= =?iso-8859-1?q?2lCvBofIYZHzImkwBgk9G682pRjrc0Sfhe1GIIEtQT29vHTnfjxLL1wTnB33?= =?iso-8859-1?q?jxRfFNiNN1GdKAjA8OfkYWRy7F91W2/7bKwVasJ348SoytsWunlxZkdgdumG?= =?iso-8859-1?q?DyhZSs9JIv3aEwpM+bHnTaywaXFJywmm6vUl3XDwIZjjxsg1aihMaP9CBpz/?= =?iso-8859-1?q?8wumAJ7lLf07zeHU3Q6onPi+rdpedLU+rQUPaj8oDgUFHfUahBEGL4e1/xmR?= =?iso-8859-1?q?nyxeGLSqmNv54E6cd7oZKfH6Yr4EjmqJDGqRkshAapJ1BnLb3+Fc+yW7bO79?= =?iso-8859-1?q?aEfcj4g4lJyT4euk1SJrjkJIhgIneMP+dX9LlDW6F04d0vCom64TkuMyE=3D?= x-microsoft-antispam-prvs: x-forefront-prvs: 0962D394D2 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(396003)(366004)(376002)(346002)(136003)(51234002)(189003)(199004)(97736004)(50226002)(2906002)(6116002)(3846002)(26005)(386003)(2616005)(6506007)(102836004)(486006)(186003)(99286004)(6436002)(1076003)(476003)(52116002)(4326008)(86362001)(6486002)(5660300002)(305945005)(7736002)(106356001)(105586002)(14454004)(8936002)(68736007)(478600001)(6636002)(53346004)(54906003)(53936002)(81166006)(6512007)(36756003)(316002)(25786009)(256004)(66066001)(81156014)(14444005)(8676002)(71190400001)(110136005)(2501003)(71200400001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4815;H:VI1PR04MB5040.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: 1I/9yQarSfgfyflzi4rpZblVB5/UDJbsGgRtH8Nlmj/Mgf3Hi9tdFsfpw1ow4u6N9AMRI4MmJ6c3QKymowmXFj5aq7+r4t3JW0mQAmgAxT13mgqr5nhFKhyq0FXU+PVvoCmKQL4sFw7epYJegYJMqehNIiw+Z/JUUadtTSGg431SU2WlxrpY11M73ot3nleIYGmZMgsdiuFHTaT6Tkltx76OUnWplwrZ5YqgoKV0jppa5nJSco2tigAo6R/deaBXow4ktoDvAeVm+rCd4ryoymFXFnVe77Tcz+bQL0IoxspNHCDqsuxrGYn9rDLDGOjmmWZcUDIN3Sof8KFLRw/LCj9MwksXh05bpIHlF3bRKvHI6zepOh47YOV0vp/PklBCZOiKmogku4+rPeh5JLh6qpbQpRjtmZBbGs0LgI/yIVI= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73923c5c-4de2-41f7-81fa-08d69d65b20d X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Feb 2019 10:15:38.8065 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4815 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 Commit 18094430d6b5 ("mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix") involve the fix of ERR004536, but the fix is incorrect. Double confirm with IC, need to clear the bit 7 of register 0x6c rather than set this bit 7. Here is the definition of bit 7 of 0x6c: 0: enable the new IC fix for ERR004536 1: do not use the IC fix, keep the same as before Find this issue on i.MX845s-evk board when enable CMDQ, and let system in heavy loading. root@imx8mmevk:~# dd if=/dev/mmcblk2 of=/dev/null bs=1M & root@imx8mmevk:~# memtester 1000M > /dev/zero & root@imx8mmevk:~# [ 139.897220] mmc2: cqhci: timeout for tag 16 [ 139.901417] mmc2: cqhci: ============ CQHCI REGISTER DUMP =========== [ 139.907862] mmc2: cqhci: Caps: 0x0000310a | Version: 0x00000510 [ 139.914311] mmc2: cqhci: Config: 0x00001001 | Control: 0x00000000 [ 139.920753] mmc2: cqhci: Int stat: 0x00000000 | Int enab: 0x00000006 [ 139.927193] mmc2: cqhci: Int sig: 0x00000006 | Int Coal: 0x00000000 [ 139.933634] mmc2: cqhci: TDL base: 0x7809c000 | TDL up32: 0x00000000 [ 139.940073] mmc2: cqhci: Doorbell: 0x00030000 | TCN: 0x00000000 [ 139.946518] mmc2: cqhci: Dev queue: 0x00010000 | Dev Pend: 0x00010000 [ 139.952967] mmc2: cqhci: Task clr: 0x00000000 | SSC1: 0x00011000 [ 139.959411] mmc2: cqhci: SSC2: 0x00000001 | DCMD rsp: 0x00000000 [ 139.965857] mmc2: cqhci: RED mask: 0xfdf9a080 | TERRI: 0x00000000 [ 139.972308] mmc2: cqhci: Resp idx: 0x0000002e | Resp arg: 0x00000900 [ 139.978761] mmc2: sdhci: ============ SDHCI REGISTER DUMP =========== [ 139.985214] mmc2: sdhci: Sys addr: 0xb2c19000 | Version: 0x00000002 [ 139.991669] mmc2: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000400 [ 139.998127] mmc2: sdhci: Argument: 0x40110400 | Trn mode: 0x00000033 [ 140.004618] mmc2: sdhci: Present: 0x01088a8f | Host ctl: 0x00000030 [ 140.011113] mmc2: sdhci: Power: 0x00000002 | Blk gap: 0x00000080 [ 140.017583] mmc2: sdhci: Wake-up: 0x00000008 | Clock: 0x0000000f [ 140.024039] mmc2: sdhci: Timeout: 0x0000008f | Int stat: 0x00000000 [ 140.030497] mmc2: sdhci: Int enab: 0x107f4000 | Sig enab: 0x107f4000 [ 140.036972] mmc2: sdhci: AC12 err: 0x00000000 | Slot int: 0x00000502 [ 140.043426] mmc2: sdhci: Caps: 0x07eb0000 | Caps_1: 0x8000b407 [ 140.049867] mmc2: sdhci: Cmd: 0x00002c1a | Max curr: 0x00ffffff [ 140.056314] mmc2: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0xffffffff [ 140.062755] mmc2: sdhci: Resp[2]: 0x328f5903 | Resp[3]: 0x00d00f00 [ 140.069195] mmc2: sdhci: Host ctl2: 0x00000008 [ 140.073640] mmc2: sdhci: ADMA Err: 0x00000007 | ADMA Ptr: 0x7809c108 [ 140.080079] mmc2: sdhci: ============================================ [ 140.086662] mmc2: running CQE recovery Fixes commit 18094430d6b5 ("mmc: sdhci-esdhc-imx: add ADMA Length Mismatch errata fix") Signed-off-by: Haibo Chen Cc: stable@vger.kernel.org --- Changes for V2 - write 0 to register bit 7 rather than remove this operation - make comment align --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 32ca3703b432..d8b0b8e81865 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1171,11 +1171,12 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host) writel(readl(host->ioaddr + SDHCI_HOST_CONTROL) | ESDHC_BURST_LEN_EN_INCR, host->ioaddr + SDHCI_HOST_CONTROL); + /* - * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL - * TO1.1, it's harmless for MX6SL - */ - writel(readl(host->ioaddr + 0x6c) | BIT(7), + * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL + * TO1.1, it's harmless for MX6SL + */ + writel(readl(host->ioaddr + 0x6c) & ~BIT(7), host->ioaddr + 0x6c); /* disable DLL_CTRL delay line settings */