From patchwork Fri Apr 15 17:29:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 8854191 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EF7C4BF29F for ; Fri, 15 Apr 2016 17:52:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 194A220211 for ; Fri, 15 Apr 2016 17:52:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AF7842021F for ; Fri, 15 Apr 2016 17:52:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750819AbcDORwY (ORCPT ); Fri, 15 Apr 2016 13:52:24 -0400 Received: from mail-by2on0056.outbound.protection.outlook.com ([207.46.100.56]:32832 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750709AbcDORwX (ORCPT ); Fri, 15 Apr 2016 13:52:23 -0400 Received: from BN3PR0301CA0017.namprd03.prod.outlook.com (10.160.180.155) by CY1PR0301MB0716.namprd03.prod.outlook.com (10.160.159.146) with Microsoft SMTP Server (TLS) id 15.1.453.26; Fri, 15 Apr 2016 17:37:46 +0000 Received: from BY2FFO11OLC005.protection.gbl (2a01:111:f400:7c0c::199) by BN3PR0301CA0017.outlook.office365.com (2a01:111:e400:4000::27) with Microsoft SMTP Server (TLS) id 15.1.466.19 via Frontend Transport; Fri, 15 Apr 2016 17:37:45 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11OLC005.mail.protection.outlook.com (10.1.14.145) with Microsoft SMTP Server (TLS) id 15.1.453.6 via Frontend Transport; Fri, 15 Apr 2016 17:37:45 +0000 Received: from shlinux2.ap.freescale.net (shlinux2.ap.freescale.net [10.192.224.44]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id u3FHb2HO019919; Fri, 15 Apr 2016 10:37:41 -0700 From: Dong Aisheng To: CC: , , , , , , , Subject: [PATCH 13/23] mmc: sdhci-esdhc-imx: restore watermark level setting after resume Date: Sat, 16 Apr 2016 01:29:37 +0800 Message-ID: <1460741387-23815-14-git-send-email-aisheng.dong@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> References: <1460741387-23815-1-git-send-email-aisheng.dong@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131052154651432253; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(50986999)(76176999)(105606002)(50466002)(19580395003)(4326007)(85426001)(2351001)(81166005)(19580405001)(230783001)(5003940100001)(229853001)(189998001)(87936001)(2906002)(48376002)(50226001)(586003)(106466001)(36756003)(2950100001)(47776003)(6806005)(104016004)(5008740100001)(1096002)(1220700001)(77096005)(11100500001)(86362001)(33646002)(110136002)(92566002)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0716; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC005; 1:VXcsx0TXBHLjv4QkTv4lPLFK/bz3IsK3gN0WswDFOakwMRS1nqHG3qKw3buXMtlmlvILMCMZZB1KxK/GTCc1hwBXQz2UhiIn36ONBnDEX/L5c7suaRDN/fPQfs9B9lrZV/GW77pHOa8LMehxpP7iJNnSV+InpGgwEKQuauN6s4yEKvtmcF9TacjMkNdCHFhKnbN/I4OcauWRbco3LF4N4B2YIkt5NHb9D0ck78ZliU0tM45ZS391R5QqQJB0e5af+WPkzwpasKzmt4iBq5GEdqLwoWu/8+ZQGPajPnq5UedmLOVLTRZd+dMJqm5O29SZsastk6tmmqVZfNKBBH2tH19sg1oss6HIhnXyIWqHuZg3LZ/p5I1/2chS+Z2JpF6tr2K6AKIyR3KhusBW23erK4pub/jXzM8LdQcp6QS3EQg9uPVi3SsN8h+FjtBKkJWtvr48I99s3exgTLZfAtbabvXcQdZWA8dSX46djGlzpXyUXmI3Z0ZE1G7q1tPY8EvP7ywBka1Kmkdd2F63YnkF9Lg4OndCkYVWUGNaeF9JH+67Zl8VOfHhVqsYtCY+hWgl374JNmEHxISHWpnyAqLzRSWt5QdSvwZJ5Ck6KQxXKanpR8KsmceUF8HblTrTHixf MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 977f375e-bb78-4879-553d-08d36554a783 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0716; 2:CilVnDCJYhOcTpd5TzpIL/JMT5dXdY0mBVTkkgPq/9maW+ABBF2SIyAR7TW3OgNIfYH/bQFab6m8NigTU//+TO4mPmjpbvEeNt6X4iYBti0M/2GIbZqeDAGmV0HHEHyuU6QFQpmKsboGBpXHmLazuB/lr5UDuoeIA7u4d1DwBa621aqj2L18Kj+kpruBsfS7; 3:54gGkg+awlWT8CuxTlanjA9QSwc3nOwS+VnE5cQ6w6c8R6VGXlwygSYjhdrT3Mh6phYveeKjFitizNa7sarsm+AM7+4PLWQOpUL/wM9a9aLKQU0vQfW7xAJBShBfJZdUnC9WHjuV+6xBg0kuQKCfjcVzTlm00uSAA4aZzrNWLVT3IYe3OQQCajzXuCRaQrL5vVBHnCAnxG9e7V67a1qQzbk2j+vpHk9qdKD3DYJFix4= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB0716; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0716; 25:JiqQW7cnn846Kz2YB4Z+UKHVgtV/xLekDz6ZMSEiEmxRUjNVZNDn2VUKvWyHJvBeyFSGYg7hQ9LJrWdHR2Sye+pVRaVHcB6jRoGXA9YyofR22PUx0MQfVGWMphd8OaYJjSF8suXn+62j+AW589vIyKkQQwIRyar6p+vzlVd/nOnY6T2LS4x8WBDIK5vFHkmm6E4H6EDWcAmRNY619liuH5NuLO3zURaJIQd2WFO8XqyjPNkOEwS+Hbhx8IY4LoAtsfVb/dYxLP60HILMbKwjZP3/bysljI1rlm2IWfpA3O/PO8aAKkwWVfufXYFNO3lZT/HX9H3l/myeVtBQR2wnW70s02Hnn9nX8BFaEPVuFQm4ZjQS1zXxq21kwDxwUbFiuw/GEIT3WX2Fta5CMy3fCVcOp3fVnB/Wfbf9ljhJhNu56rA4BabQfm4+za8HNkUuRWUtAUIhcpcGw8TSU1ibG71reXp08PcOL258jnGFgAFOQentoG4ZZTJ76G7zWXWCU21r2djlmBbWRFO6tEo9iK00kEfEQyc0wC6aRfLeVxFjL9qij30RfW6pFqwHHBuq3VeTMGu9b6Ds5PqagoGRtsz16CPxP1k6YhyhhRh39E4ZD1wxfnuQkoWJS098vL+ggJfxG8FnihJutNmC0t3ejgmGBfIl+QpaiRP2TK6CwL7e8OhTXgsnloJDMo/Q4CQq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13024025)(13023025)(8121501046)(13018025)(13017025)(13015025)(5005006)(3002001)(10201501046)(6055026); SRVR:CY1PR0301MB0716; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0716; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0716; 4:jpRn/XfQZ/JAdOw4uWXuf2G0+0PuFOUGDFnBrXUw5ki/T7FaHRm8LULKLF0L9BZPf00LFBRP/QO9YtlSXNUJNqQa2NGeWcxshCv7cqdlbLh1ZHXRz/CZVfdXUMp+YvZ5kvX0b1dzj3HKdCGa6YIGAOhU9tiJzxVcBUcKh8/n/DH9/bkYDhpIsuORxOB/29D3HHPaLECpJbGXYRfHFyvLRfBldP31gVkz3ebljqwiTPkdh1pv4Z7teP4D5W9ZLU1WDAai/ss7aXWgWbmiyXaO/CHPvaSpABtgG6rW0Zq9BcqjqlYqZZXP6/VgiHMSzesur1zDOrL0QBsnh4TJReYVRgPtfulpcRaNLbDCmxGG3WlZP9ZO/8SF2ieDmo58y8QO0s3aZh7lMgca9PNz827kUDfWKa0tcWM7rMNw6M6jYmpuKCR94EbKtlQPME4ZtCLPYpATOr+qucI4aPvl8q14FcourXklV3WA0IVcBd2OrKc= X-Forefront-PRVS: 0913EA1D60 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB0716; 23:Qx74btW1+ZGVLagVzH168OEzOQyQhnZ0+EbjsfG?= =?us-ascii?Q?ofrF8la/T8p2A/snGQAMb3Id/fF0Jf8CDO5EEPS9wJX1PYERYUkGDzw5Enmw?= =?us-ascii?Q?7C+32aMTSXfUmouIwRuuB4HPRRfgRwB6VDp4JdiJw5n+KQy/y+tYDRykshmB?= =?us-ascii?Q?aPTZkhvKjoJB5CrYP1dyKgE2Tc5R5b171aUsefRGlq7jRkxuT9rPVlI/zt0K?= =?us-ascii?Q?52eJdKUx1H1sCU99QqU7FbUmMtIoC520ZlS+48c80TtAWo9JYTWVLIQJgNLE?= =?us-ascii?Q?tNhqHyPj5TaHSSDMmDglYXVQkCTtGpd0qVZUltR3eJnZZ0ObqfsA0rmSfbzn?= =?us-ascii?Q?37LRn5DRS0kzDaIoUiOZuxlpnhJjlYTILYaPm5EuYRDbM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A5g=; 24:fZiYm+uA9V1yts5Sphu/xdPW3WB7bDpez5by0/XNcVC2d7Qu8FHcSUGpPpHZc84QmBc5D33Q+9Jdkg26/DO96vtmCgVM5xAUG9dyOoFs4G4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2016 17:37:45.0340 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0716 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 restores the setting of watermark level register after system resume back. Signed-off-by: Dong Aisheng --- drivers/mmc/host/sdhci-esdhc-imx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 6fef6bc..4c28fbb 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -1261,6 +1261,11 @@ static int sdhci_esdhc_suspend(struct device *dev) static int sdhci_esdhc_resume(struct device *dev) { + struct sdhci_host *host = dev_get_drvdata(dev); + + /* restore watermark setting in case it's lost in low power mode */ + writel(0x10401040, host->ioaddr + ESDHC_WTMK_LVL); + return sdhci_pltfm_resume(dev); }