From patchwork Wed Aug 21 12:42:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seungwon Jeon X-Patchwork-Id: 2847704 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A40E4BF546 for ; Wed, 21 Aug 2013 12:42:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95DE2204FE for ; Wed, 21 Aug 2013 12:42:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E202620363 for ; Wed, 21 Aug 2013 12:42:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751492Ab3HUMmY (ORCPT ); Wed, 21 Aug 2013 08:42:24 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:48311 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486Ab3HUMmW (ORCPT ); Wed, 21 Aug 2013 08:42:22 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MRV00FJMSML7AG0@mailout2.samsung.com> for linux-mmc@vger.kernel.org; Wed, 21 Aug 2013 21:42:21 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [203.254.230.48]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id D2.2E.17404.DA5B4125; Wed, 21 Aug 2013 21:42:21 +0900 (KST) X-AuditID: cbfee68d-b7f096d0000043fc-3b-5214b5ade07c Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 9C.27.31505.DA5B4125; Wed, 21 Aug 2013 21:42:21 +0900 (KST) Received: from DOTGIHJUN01 ([12.23.118.161]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MRV00CO4SML7970@mmp1.samsung.com>; Wed, 21 Aug 2013 21:42:21 +0900 (KST) From: Seungwon Jeon To: linux-mmc@vger.kernel.org Cc: 'Chris Ball' References: In-reply-to: Subject: [PATCH 1/3] mmc: core: do power-off with resume failure Date: Wed, 21 Aug 2013 21:42:20 +0900 Message-id: <002201ce9e6b$e0b32850$a21978f0$%jun@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac03z3aCvVFr8FaITt2vKVQKst76fw3Ogf7QC4iI1hAADVzV0BBOVxiAARu2RyAu11E0YA== Content-language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsVy+t8zA921W0WCDDqPCVhsf72RzeLI/35G ByaPQ1fWMnp83iQXwBTFZZOSmpNZllqkb5fAlTH3/1bmgns8FW/P1jUwHuPqYuTkkBAwkZj0 8DUjhC0mceHeejYQW0hgGaNEzwZNmJq9n+cB1XABxRcxSmy9Mp0NwvnDKPFy8g8WkCo2AS2J v2/eMIPYIgKyEj//XACbxCygKPHj91r2LkYOoAZuidXNQSBhTgEeiXV/OsHKhQUcJK5+bgEb wyKgKvF52hewg3gFbCUWXF7MBGELSvyYfI8FZAyzgLrElCm5ENPlJTavecsMEpYACj/6qwtx QIREz+eF7BAlIhL7XrwDO19CYB27xIQ1h9kgVglIfJt8iAWiV1Zi0wFmiHclJQ6uuMEygVFi FpLFsxAWz0KyeBaSDQsYWVYxiqYWJBcUJ6UXGeoVJ+YWl+al6yXn525ihERZ7w7G2wesDzEm A22fyCwlmpwPjNK8knhDYzMjC1MTU2Mjc0sz0oSVxHn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Zvtj7eVbzpztr7hVoLuTaUKE1iemxj9DnO5tK8n3+qdsoYK7EUZyQa ajEXFScCAMyaA/AmAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 there is no mmc_power_off() when resume failed. Somehow, state from mmc_power_on() will be kept. This change makes a pair with its use in case of failure. Signed-off-by: Seungwon Jeon --- drivers/mmc/core/mmc.c | 3 +++ drivers/mmc/core/sd.c | 3 +++ drivers/mmc/core/sdio.c | 3 +++ 3 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 6d02012..704a561 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1536,6 +1536,9 @@ static int mmc_resume(struct mmc_host *host) mmc_power_up(host); mmc_select_voltage(host, host->ocr); err = mmc_init_card(host, host->ocr, host->card); + if (err) + mmc_power_off(host); + mmc_release_host(host); return err; diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index 176d125..2690ae1 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -1099,6 +1099,9 @@ static int mmc_sd_resume(struct mmc_host *host) mmc_power_up(host); mmc_select_voltage(host, host->ocr); err = mmc_sd_init_card(host, host->ocr, host->card); + if (err) + mmc_power_off(host); + mmc_release_host(host); return err; diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 80d89cf..8c65669 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1033,6 +1033,9 @@ static int mmc_sdio_resume(struct mmc_host *host) } } + if (err && !mmc_card_keep_power(host)) + mmc_power_off(host); + host->pm_flags &= ~MMC_PM_KEEP_POWER; return err; }