From patchwork Thu Sep 1 14:24:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Lemberg X-Patchwork-Id: 9309215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AC43860756 for ; Thu, 1 Sep 2016 15:02:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF338293E3 for ; Thu, 1 Sep 2016 15:02:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C28E329427; Thu, 1 Sep 2016 15:02:42 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 934DE293E3 for ; Thu, 1 Sep 2016 15:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932896AbcIAPCh (ORCPT ); Thu, 1 Sep 2016 11:02:37 -0400 Received: from mail-by2nam03on0084.outbound.protection.outlook.com ([104.47.42.84]:48064 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932680AbcIAPCg (ORCPT ); Thu, 1 Sep 2016 11:02:36 -0400 X-Greylist: delayed 1092 seconds by postgrey-1.27 at vger.kernel.org; Thu, 01 Sep 2016 11:02:36 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sandiskcorp.onmicrosoft.com; s=selector1-sandisk-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=NU7RO4yZPpR7V7yMpNZy+59baxnNylmae4Vu8IA6dw8=; b=kOLN4r+TD87/IAK5ZiKqr+5re3tHyCvabwRuEZG6c4aK7m76a4LUp8VItAtOEoTB/RxgXiVSJ8xbFQwwQQzRhq7EJVCQ3wNWJz1D7aMKwzv3LFL4EY6nUbf/dpiDTNMb49JOBfAnM4aEnhz9r3XDCdJrlG3UCOcDc7rHGWA1qtQ= Received: from BY2PR02CA0051.namprd02.prod.outlook.com (10.141.216.41) by CY1PR02MB1304.namprd02.prod.outlook.com (10.161.170.19) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9; Thu, 1 Sep 2016 14:29:08 +0000 Received: from BN1AFFO11FD007.protection.gbl (2a01:111:f400:7c10::120) by BY2PR02CA0051.outlook.office365.com (2a01:111:e400:2c40::41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.599.9 via Frontend Transport; Thu, 1 Sep 2016 14:29:07 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by BN1AFFO11FD007.mail.protection.outlook.com (10.58.52.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.587.6 via Frontend Transport; Thu, 1 Sep 2016 14:29:06 +0000 Received: from MILHUBIP03.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id B7.28.26959.C1938C75; Thu, 1 Sep 2016 07:20:12 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP03.sdcorp.global.sandisk.com (10.177.9.96) with Microsoft SMTP Server id 14.3.301.0; Thu, 1 Sep 2016 07:29:05 -0700 X-AuditID: 0ac94369-b97ff7000001694f-14-57c8391c800f Received: from alexl-VirtualBox.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 90.B3.02783.03B38C75; Thu, 1 Sep 2016 07:29:06 -0700 (PDT) From: alex lemberg To: , CC: , alex lemberg Subject: [PATCH 3/3] mmc: Checking BKOPS status prior to Suspend Date: Thu, 1 Sep 2016 17:24:50 +0300 Message-ID: <1472739890-3384-4-git-send-email-alex.lemberg@sandisk.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1472739890-3384-1-git-send-email-alex.lemberg@sandisk.com> References: <1472739890-3384-1-git-send-email-alex.lemberg@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrLLMWRmVeSWpSXmKPExsXCddJ5ka6M5YlwgwMnlS2O/O9ntDi+NtyB yePOtT1sHp83yQUwRXHZpKTmZJalFunbJXBlLH3OW/BXtGLxjcNMDYwvBbsYOTkkBEwknv64 wNTFyMUhJLCUSWL3wxksIAkhge2MEn3bE2CK5vy+xQpRtJNR4umGE6wgCTYBXYk9/R/AGkQE LCWuTFnGCGIzC3hLPOl+BWRzcAgLOEgs3V8IEmYRUJG4/+caM4jNK+Au8au7gxVivpzEyWOT WUHKOQU8JG6s8YU4wV1idt86dpC1EgKfWCSOL5vICNErKHFy5hMWiFUSEgdfvGAG6RUSUJU4 +7ZuAqPQLCRVs5BULWBkWsUolpuZU5ybnlpgaKpXnJiXklmcrZecn7uJERKomTsY7z7xPsQo wMGoxMO7Qf9EuBBrYllxZe4hRgkOZiUR3tXAMBfiTUmsrEotyo8vKs1JLT7EKM3BoiTO63bv S5iQQHpiSWp2ampBahFMlomDU6qBcedKhj2KYXNL7+2smdh59R9TUaaUfI6RxGbGT7fO/uPw vXBm+4tWhfBVV88fEL9yMn/XxLaTl5OM+r6FnGl7ncH1SEXshOe27Ts9Ir8tjvtS+GauJfsW ab6/EUdWiOSXXtn6d9mC2WXT98o8YNkadnSnVNqxtkhNA4tHM1f/tA/YPLG5Lmdn4wIlluKM REMt5qLiRAD126fZUAIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprMJMWRmVeSWpSXmKPExsXCtZEjRdfI+kS4wbYvLBY3H/xgs9i5dx2T xZH//YwWx9eGO7B43Lm2h81j2przTB6fN8kFMEdx2aSk5mSWpRbp2yVwZSx9zlvwV7Ri8Y3D TA2MLwW7GDk5JARMJOb8vsXaxcjFISSwnVHizvYX7CAJNgFdiT39H1hAbBEBc4mHy1qYQWxm AW+J80tusHUxcnAICzhILN1fCBJmEVCVuL7lAlg5r4C7xOczJ9gh5stJnDw2mRWknFPAQ+LG Gl+QsBBQyey+dewTGLkXMDKsYhTLzcwpzk3PLDA01CtOzEvJLM7WS87P3cQI9jZn5A7GpxPN DzEycXBKNTBukOQX9nv+O6/GIcdg0d4DujsY5ntVb3jauv7+51anaTYbFH5qqN0/9lcyZmdV GEPcvgnmwvu9ejJ9snLCpj+JvuS9K+XkjN6GQ0FRFnIrOZaoCkqHB7f/vu6hJ5Nkp9btciL3 /46NAu+3XElk3cI1MzPDwqLhiISg/q4LE7cUM8W3f195QUqJpTgj0VCLuag4EQCqqw4IpgEA AA== MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(86362001)(50466002)(356003)(229853001)(106466001)(86152002)(5001770100001)(4326007)(305945005)(2906002)(7696003)(4001430100002)(87936001)(76176999)(586003)(50986999)(7846002)(47776003)(36756003)(2270400002)(19580395003)(8936002)(69596002)(33646002)(92566002)(68736007)(50226002)(97736004)(81166006)(5003940100001)(8676002)(15650500001)(5660300001)(19580405001)(2950100001)(107886002)(81156014)(77096005)(48376002)(189998001)(626004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1304; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD007; 1:lk9Z0qJT68kJcjfaV93tI/qeafb+xG+MGuesQHNMwlrDsdJGslo2aRd2jb5Wco6jNXOzAdxLYlicoGVI/M/oRXdwj/ZLTOhMFf3a/vB2diAGTNsNddjvsNvDAVrry6xuBmBLkyRj3v3yJIew262Do61+KDhUIsQA7526AvcHb92KN0AdP1oVrfxUEYC2fHmHBBHscdTqdyz0YC8fyzfG++3yO1SXgHkXycGEOLW/Fv7etYZBBfR/VWmP7S4g4D4IKNGBG7u9dKWnFmVXxhjo9bBrzsjFQSBD5rZmfWcld9myPZ62Xwn9R2bvd1D7j/zrXo99LnRdORRDFQqMuT4DRdMZVGL5mtkIZJ6PVdLVS8qgbW56k5yLdP4/jnlOIdtNLzP7aE/k36qO68CJqUthYyneOO3lT4py3YgOs90pFABENlCWIRXwSocbtJ8sYj6GHxB4X+zKffke7oR3qOgmhb9x43jRQ+leuA5dm8Ju9BzLxlb70svEICKZefi4Li8v1qhrO+FrniA7MY/od2sRpQ== X-MS-Office365-Filtering-Correlation-Id: a9a9e5d9-2727-497e-4561-08d3d27454da X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1304; 2:RL1uP7aiHeFyOnd/t42piXzjm+cva24GbdMHnySi3k8KfSesCmRhDmMmP+ubcn0E7LM8Y/gmaVKSa4RlOVAkCDnOXVr24brwF/kiQrH295sU24NBlt9yvge3trH9PZHWER4fk8McbYoabDEgs1ESPweQIUAZ0+1fMGMk3S3gUS8KKCLz4x7jlLo0wlP93tqA; 3:MOR8GxVsqjFeU9UXqJIbO5xlX5RsUCPHKRETkstCf3HixdopYSug30vTM0MIBlNNE912GKnc0WwPF7X0EeDsTVWBNP5Kf+H09jXHHG+vbHQdfPFn0/YEXpkVsORcZ1paaWVLakGIfEfUKRwzUqWMkCo3Ir6ZNmBBVYUnI4KfIwPFpPl+/A1KDCTv/Zv8LvnMmdjs0Rp0uYE01dYBFredHfPS9yFfm5/XWRHsLlerteb3OdZoAJ3doq/qsWxILEuM9yxZuU43VClxTuOUp9c9PA== X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:CY1PR02MB1304; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1304; 25:rglJYfUw4gPln5FVbJBGh3M0t2WboChoR2U9N9eIRdFIUhSQPRCo8ZE+fgz+SuUWCAsvbI7dmK0bSJl6f9C48vC5zuraTHWOMqG4Dy6jf5lrp1nWjvY15ex6doEpy3x5uBYCnknnhhMhlqx0bjT7a2VjXGVmvRCm71ndkRry22Q+Li/EmY0c0o9HDGiGUOITXLqtOEnzUABrwoIPOgv2jn636GW8NVzZ1Ss2rwhTnySIwmKwv16cAEcsW8jYCzbtMDOX930BLf1Zsjv8PoLTvpdM3p7yzYM4uxN3zdbvyI7VBxP31BS8Ly1kF3sSNYusx8bXL/+cEMaV8QJxAisMRu2+l1yc3DCI3SjgjE8gCIiOP5+X99nnTdNjJpErj3Dq36Ea1R1485UykpCf6wjcNxPbY6O4OipWCLIr26W5Ko+oiPk0/522iZZysyuCU1qWqtR76BbBxd5+IQUVnSiX4Ips6lnqHF9QPir1CWBK4WxUYZrBkUfYSYZWfV6EyovwQeoIuKQaqWUT7gZpZ+4FIegOQr79GXDBwok6BrAPRLVIEpnFqwOPOkMjo4JnNxB4r+TsjWS1gLt70HSw39qjLQ8QIIIpRxxv2WBEkTFKGD0kj9eQbhxXd5zNEIONXQ9doEecSusF9HViAwujgc8stfsFHufH1EbeQcHnm8ssH7WHeWt5Ly969MleOiRfGinTVjzsI9YArFkqUE2pacchAoGItIznr2O8nWRAHQQG0VXz3HE5fEqMi72p/ZgRGbZM3huEYOBGV1N7+ntLejUZwbJdqSDvStmIEM0LGi5/nC4= X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1304; 31:tz1td3gMm2YLNdsTmf9ffpCU0+RGESAqtqs/IoSE7l7Is7E9uwm8QPL8ik4hymAiZUaZRhIRUqHrTvdO6EsCONclhnKj7XjvLIifrjrWFFtZRQ4jtwAzHtqvQ/FHt2Q3aGA40/fHhnwf6C4/qbqLdUyxhLHC27A0v4eDAKwB0WHZ9o1+k0gHMVhBYp1SKZcsw6gafAlhOwvolwq74zJLsbGF5KET4KYK8OnzeJccExY=; 20:3rkONri3nmWbf1dq6YxeeP3RfkxqQNMH3YkVViZ41Zu5gLOxZOzgJbyino2B4LHvL2uzqZstJtQb/k8R+zqNY+lvE46azaS26OfKB3kBHYzKZDjx/HdKM0jfbD+dzcgGIJV9nrqFnYnP1Ylat3Hvp/Pq9KKKsvb/v62kdNe773OV9fxMD9ctJ19K7lornbO99+ju7nZk3wpwDrxpWJFMwJ96vNMZIqYRzGiFyTwVYqNiVlToiwGp+Iynb0n03417FC5OjYHExZHMa1AaBW7vb5T1phcs5hyMRoIb7z62iFk6MkgPIVXceksbnj8CaueP5In5I4q87vjWHQiKF03yteNhDk0yAV+Lok+rvApofAToyj+g4EcaaC14C3BflRdBR4liMJxOV7a5AWpLNAdM+KlE6J2ZlGQeg4MGrL2ZU5/lUWwfU2XqltE1YE8wCLS2leth2up5Uj4i1G7rjt1ktwFk72Yk5f2ODqSptSKCNLL13mdJpWw6CbR2nFsr2qri X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13016025)(13018025)(8121501046)(5005006)(10201501046)(3002001)(6055026); SRVR:CY1PR02MB1304; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB1304; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1304; 4:o6jwmCzPFmFJcsIzMVLRLp7PtJYCIb9AoMrwX/hyEXDcUmQsEqYU2Idp6tos0Hs+Xdhc0f9BTob2hnvd3vjUj/3111k4W1bPzjkHqGdEVI0vOxtFVlZ0eyWthYg05KBtQ8BoxQQYojuQrEWpffNSKICf+2kLGPxrofvq4KDRBEcfk06uNbtAseRJqQoUPYvXw/REoEu2vAQT2quQaFkJN9eX11pb4Em99iRYrH23N/CdhofUMQJ6F1V8IyHZzxPrpTt1Q42wAhSJcMgkAphnndroa6Ck+4ItauExAuV+dVGa/cQt/GBKL376nqQpx09awx2O3ciRiYnV3sbKkPmo6Yuvvw6ET/qbh2OgFKeUKEOarZaOfUqVTBzwLoD4X24iW4C0uXD54KdI5dF2NMCTnim9/Wwx0PgCbxqWWVMlkwD06Or8LC21cN05DN7oA2fK3LI8tFr60T0r3ydyfDMQho5eUlZ8shkASK07WkDUvKs= X-Forefront-PRVS: 0052308DC6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1304; 23:VyZVooss4uHgg8rYR+tLtpRmr5PB8UVo9GSoU1jmA?= =?us-ascii?Q?f9whp03rl5vWrcBUsvbVb1CntVHdw0AUvR5RFQgnuEp+5wAhaO4lDmVHSAwz?= =?us-ascii?Q?4vAZW+Quh4i80y/GtngFVqIVGo1kKjb94j04lpM3PBDxlAJiGlkRS7Ypc3hF?= =?us-ascii?Q?OnblqWB3YlL70wQr2j4kFtsVwYpL80mdszNTWUBH7DaYGQXOK+Qb1Ta960oP?= =?us-ascii?Q?Wnzqy+rkOCkLotxh/3mTQm91FLA6f4t/zF49WJsNp8Fux/UMRQ2sP3WBn6SH?= =?us-ascii?Q?T5iyDfNTPEj2OV2xMqZLqC2Pf7ySw3RFSuptBYuT28BMqgEHMrYtimMFKowj?= =?us-ascii?Q?iw+Oua6N6lS1jLOE1jVHPldJ0YEK3gLltUgkZdyvosWmswN4yJy6bK0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mQqGC9B3IjBNIh3y47bB+13KlkRmrn7g/gPz3SyjPNa7mMq04Us7A4C6txWVFm2dCRIISEQ7ZO X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2016 14:29:06.8193 (UTC) X-MS-Exchange-CrossTenant-Id: fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fcd9ea9c-ae8c-460c-ab3c-3db42d7ac64d; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1304 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 Rescheduling Suspend in case of BKOPS Level >= 1 in order to let eMMC device to complete its internal GC. Applicable for Runtime Suspend Only. Signed-off-by: alex lemberg --- drivers/mmc/core/mmc.c | 30 +++++++++++++++++++++++------- include/linux/mmc/mmc.h | 1 + 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index e2e987f..c4c6326 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1904,7 +1904,8 @@ static void mmc_detect(struct mmc_host *host) } } -static int _mmc_suspend(struct mmc_host *host, bool is_suspend) +static int _mmc_suspend(struct mmc_host *host, bool is_suspend, + bool is_runtime_pm) { int err = 0; unsigned int notify_type = is_suspend ? EXT_CSD_POWER_OFF_SHORT : @@ -1918,10 +1919,25 @@ static int _mmc_suspend(struct mmc_host *host, bool is_suspend) if (mmc_card_suspended(host->card)) goto out; - if (mmc_card_doing_bkops(host->card)) { - err = mmc_stop_bkops(host->card); - if (err) + if (mmc_card_doing_bkops(host->card) || + host->card->ext_csd.auto_bkops_en) { + err = mmc_read_bkops_status(host->card); + if (err) { + pr_err("%s: error %d reading BKOPS Status\n", + mmc_hostname(host), err); + goto out; + } + if (is_runtime_pm && host->card->ext_csd.raw_bkops_status >= + EXT_CSD_BKOPS_LEVEL_1) { + pm_schedule_suspend(&host->card->dev, + MMC_RUNTIME_SUSPEND_DELAY_MS); goto out; + } + if (mmc_card_doing_bkops(host->card)) { + err = mmc_stop_bkops(host->card); + if (err) + goto out; + } } err = mmc_flush_cache(host->card); @@ -1952,7 +1968,7 @@ static int mmc_suspend(struct mmc_host *host) { int err; - err = _mmc_suspend(host, true); + err = _mmc_suspend(host, true, false); if (!err) { pm_runtime_disable(&host->card->dev); pm_runtime_set_suspended(&host->card->dev); @@ -2002,7 +2018,7 @@ static int mmc_shutdown(struct mmc_host *host) err = _mmc_resume(host); if (!err) - err = _mmc_suspend(host, false); + err = _mmc_suspend(host, false, false); return err; } @@ -2026,7 +2042,7 @@ static int mmc_runtime_suspend(struct mmc_host *host) if (!(host->caps & MMC_CAP_AGGRESSIVE_PM)) return 0; - err = _mmc_suspend(host, true); + err = _mmc_suspend(host, true, true); if (err) pr_err("%s: error %d doing aggressive suspend\n", mmc_hostname(host), err); diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 0fe3908..0f08d5c 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h @@ -430,6 +430,7 @@ struct _mmc_csd { /* * BKOPS status level */ +#define EXT_CSD_BKOPS_LEVEL_1 0x1 #define EXT_CSD_BKOPS_LEVEL_2 0x2 /*