Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752226AbbKJJjq (ORCPT ); Tue, 10 Nov 2015 04:39:46 -0500 Received: from mail-bn1bn0106.outbound.protection.outlook.com ([157.56.110.106]:27328 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751861AbbKJJjl (ORCPT ); Tue, 10 Nov 2015 04:39:41 -0500 X-Greylist: delayed 72892 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Nov 2015 04:39:41 EST Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=freescale.com; From: Haibo Chen To: , CC: , , Subject: [PATCH 1/2] mmc: sdhci-esdhc-imx: move the setting of watermark level out of probe Date: Tue, 10 Nov 2015 17:43:29 +0800 Message-ID: <1447148610-2770-1-git-send-email-haibo.chen@freescale.com> X-Mailer: git-send-email 1.9.1 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD029;1:bPAqahemkjI0ymuUvX2YCWveoeAyYVArkTIJrBCtHQQoAeiWetQSQ4Z5VIFZwEjQoKPvOLeTrFZEAWxUNcc3vxIMRy+2fTJ0omA/oEDIrYr4pfT2LGDUdv99ws/Ij5IuTMgEUCTSrkfPBOXWJkMSd/W5XJJ6vBHEEGFRg2jZrRJGHfhKPPJbb8n0ToQSN2cQHpsqQ+uW3C0X/Viti3WrrxYl1Hv/MRGDZfjRg4VQk/xNkvSWSTNn0cJe9jilaXKeMTZH4UOhkChFZ1fMl6jWGnl5+M5S8ZLINL+RDezZrWI9GWqYTIgbW5whZ4+zBLjLDE20HMR+5ixzXxylsXUGfNQpMzSHdMbFTyc6MzeDM1IL3+HCsVPeesFX3TC32aY/6cTKi9X+2lEUj4eu1yI/cw== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(33646002)(6806005)(11100500001)(5008740100001)(81156007)(5001770100001)(5001960100002)(104016004)(77096005)(97736004)(69596002)(36756003)(189998001)(86362001)(50226001)(5003940100001)(19580395003)(4001450100002)(19580405001)(5007970100001)(87936001)(230783001)(50986999)(229853001)(92566002)(105606002)(47776003)(106466001)(50466002)(48376002)(85426001);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR03MB1423;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1423;2:QHGbcQLeXevZ3ZW9GKk7XPuV7U6kvdWgsehGzLSBrZ7qPEnwX3ZtUrKudOEh5RKMfsEx5I3vBdJjpQBwlxhd23D+BM75KrTn42fTqAo3+P3a9iOMFZcTnIx3gVwR1O1COlTlMOqno2eN1P+znlw+LDOZ//+drOKcathekz4aLxU=;3:83GHrSH8XGTyOv1u2014ieRdcYRglBKx/4LfudRmC6KqZy8pL+KJitVBOrLIFIWN2Cu/h7L/onId3KOlFW2wYcXubyePd6FhRFvx/2ole2GzSFbeJD6AenIA9i7KwOack5fC9R/MNp95e6QsYPvrfMYmFEZL6N/ffYUBN8+qw8C3Im53nXRtxqt8oWKu2DemvPov6eIA4gaAAm3lSuQ30h8pO7aDegLBx7DWakIxSxg=;25:CFyvQnxpoz0lNhTnXL/XVH98kuFJqr3651+onCdk69NaFdJAWFBBwrPPVgLeIm8fGD0IAAw1eVB4lrktii5iVMW4JhvVpbo9ztf9sgv6wysPizF7zLjdUUlEMBe/V8ePI1UrjjgowhXrDTqodiewMz0Jbnyzh3V6Yj9Vn4TKlem4tbKSELJSF/JIvxMYpVnVPqsmHi4zSCL3BAlTSpE/Zmt7wKQmU1GNRCndLhWMzHvLfVhshmlgiazBqFy+bbwf8mo0N+/IM0CK02FILORNiw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1423; X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1423;20:+RN04T4XiQ7Gohgofcta+9YEKVUFWXxfb8sJBdK8ATVu3wi8L2UyReJNED/WIkk4tnU8RKFi1YrgmJrWI2QPwaJgxHC5MPvGwhXT80vXcXzjafZ10sTFMpZUlNUpH/UQiUXHSEkIF6vyGvuzd+kuitu/chPy/nCoJqi2bf65TaFv5As2itgc3wx2iPOXK5lZrYOU/5MSYmbHV9FJG9iKfs8o3xB8J4wEEHvKfL9t3fpbqAoQ3hmt4PdbOFPe7/wsF5v2cNQItGK+4zTtfJAOsfuv+BIYgzxsevU8CFJNHgf+TIA/rFmTOuNQl6sNvYIuTOxz+9W/IWecKRSf+ptX3km9o0sltcsFHDcEo1oeEx8=;4:355SKGHy9fjiKHuQmDVTC+UzA9qR8GgP+/dBTlCwLBxDjcErbKmoWsZcm+Cgs2eyGuYcoEn0HgpVCVFJMilEdumf/JVcBViJa21SIAVWRYWa2onopgWXmPTwN/WO9yF4d9HVAzxrGgG603GOUzz6iZXRfTyPGlOjqPJht9XkfU5avzfqT/DETaFw7T6kOPeNZWYTbKDCoV2XQjKJTJSA8co1Wuxi7q9YOe7CiLEYy++6SoDntzz3Cg7Udsyc05qBX92I1hY2hlOrXoEhJm8qinjn2uRUE7bjzpiFqDRilYsTYVvDQRrrKCNYf4GB3x3yoi2mi3V9BPO4vsKi8tEIE2VuPPOiBKr/GasQjjiQVy2qGwOolih8kFAUL2fPwTAd X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046);SRVR:CY1PR03MB1423;BCL:0;PCL:0;RULEID:;SRVR:CY1PR03MB1423; X-Forefront-PRVS: 07562C22DA X-Microsoft-Exchange-Diagn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//W5FV4rbEEQEcnlZ2kKAnD?= =?us-ascii?Q?2u97C4m6Xpl5NKHd1+prFzxfbEQvJbUkFTEfUK2sSJTNuc75cTlgORyzWllc?= =?us-ascii?Q?n3KYs1272r2giWdn6wu4qwZak6qMlo4TdzsZ+5+zLrFib8HHaaX4NGkmZ0HF?= =?us-ascii?Q?GRw2clOsQw6nWLCe9T2rdwflKyQghdQxnV+mk2FZm1bM3R0KjHvtQHxROGkt?= =?us-ascii?Q?vswflI=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR03MB1423;5:lht+LP7m6hsmzerDU18FrnSvCUSn0Yk8x6D+1cfyWWWrChlHnBds2fwDhioM19i+z/aF5VO6i/YjM4X7HrwdwUX384jAK6v6EpTYMmX84qZ/nQhaxUgWoYh9vA82nmS459MmrPGzwJPgHrOC37r1Ww==;24:Ed5kzgyc8qcFDLri42OyPCfvctJCXx56SDljGDpqzQ49/jdf6B/AgL/DoO94yw9I/2+wxq5O0cK8qQNev9W3KHI/TPwgCAlK6lzPlHeBt2Y=;20:jxYp728bvk2S7NA7D1cjQeywFRFUKRVkGIPKdvLCq66bcttIJXjihCPAJ6QHh8zkJSSEHwI1zwXCf1xwc41XZQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2015 09:39:37.8307 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB1423 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2135 Lines: 57 Currently, we config the watermark_level register only in probe. This will cause the mmc write operation timeout issue after system resume back in LPSR mode. Because in LPSR mode, after system resume back, the watermark_level register(0x44) changes to 0x08000880, which set the write watermark level as 0, and set the read watermark level as 128. This value is incorrect. This patch move the setting of watermark level register out of probe, so after system resume back, mmc driver can set this watermark level register back to 0x10401040. Signed-off-by: Haibo Chen --- drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 1f1582f..1508949 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -584,6 +584,14 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) mask = 0xffff & ~(ESDHC_CTRL_BUSWIDTH_MASK | ESDHC_CTRL_D3CD); esdhc_clrset_le(host, mask, new_val, reg); + + /* + * The imx6q/imx7d ROM code will change the default watermark + * level setting to something insane. Change it back here. + */ + if (esdhc_is_usdhc(imx_data)) + writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL); + return; } esdhc_clrset_le(host, 0xff, val, reg); @@ -1155,13 +1163,7 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK | SDHCI_QUIRK_BROKEN_ADMA; - /* - * The imx6q ROM code will change the default watermark level setting - * to something insane. Change it back here. - */ if (esdhc_is_usdhc(imx_data)) { - writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL); - host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; host->mmc->caps |= MMC_CAP_1_8V_DDR; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/