From patchwork Tue Apr 16 10:00:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 16152 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 9083023A3E for ; Tue, 16 Apr 2013 10:02:06 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bs12sf616943qab.6 for ; Tue, 16 Apr 2013 03:01:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=c906K9wkwyqYRlzq6T2HJaS9PEy0kl8ZgjUOxpl4BX0=; b=GYCRbnXgPzOccBLJbzXu40nHu/Fhb84gEXEIncG0kSbzmy/YFJt7S+IVTvrzGAlmsQ onnLfs30jBKwwrNT64GC5mjJfB0PLDu0m3rNXRQjHKeaDU3WDOmtrSF3CGhCFQUN8zfj xrXr/wTNclQQGb+miy6Z/zbPFi1fPss5BvAcGcNZT4ot8Ts4Utn1bCV+HDy9Q0G3V6aI 4linhJreQNsOKVTteYI7DCahDpQPHjkDyFmfVC10Q3cU6fHYCrgKXGuZ3aJrQMA5c6FZ 9ob8wQZa2dP3tKLvhqo0KWf5fzN4PhXwanJpQdzb+B87+M/JrJR6+QCr5//Itr0TgoFZ hKfA== X-Received: by 10.224.160.65 with SMTP id m1mr1362816qax.2.1366106494157; Tue, 16 Apr 2013 03:01:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.127.195 with SMTP id ni3ls253779qeb.1.gmail; Tue, 16 Apr 2013 03:01:33 -0700 (PDT) X-Received: by 10.52.69.75 with SMTP id c11mr794190vdu.119.1366106493883; Tue, 16 Apr 2013 03:01:33 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id p12si759362vce.68.2013.04.16.03.01.33 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Apr 2013 03:01:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id jz10so241154veb.5 for ; Tue, 16 Apr 2013 03:01:33 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr813239vdj.75.1366106493659; Tue, 16 Apr 2013 03:01:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp16541veb; Tue, 16 Apr 2013 03:01:29 -0700 (PDT) X-Received: by 10.180.91.131 with SMTP id ce3mr2522088wib.5.1366106484998; Tue, 16 Apr 2013 03:01:24 -0700 (PDT) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com [207.126.144.113]) by mx.google.com with SMTP id d7si1590889eep.216.2013.04.16.03.01.19 (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 16 Apr 2013 03:01:24 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.113 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.113; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKUW0hZkNoYWRoK0HBqRnxeAHuiEEkJMDV@postini.com; Tue, 16 Apr 2013 10:01:24 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 29FA31CF; Tue, 16 Apr 2013 10:00:44 +0000 (GMT) Received: from relay1.stm.gmessaging.net (unknown [10.230.100.17]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A7B8D4C6C; Tue, 16 Apr 2013 10:00:39 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay1.stm.gmessaging.net (Postfix) with ESMTPS id B92B424C080; Tue, 16 Apr 2013 12:00:37 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.279.5; Tue, 16 Apr 2013 12:00:42 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson , Maya Erez , Subhash Jadavani , Arnd Bergmann , Kevin Liu , Adrian Hunter , Daniel Drake , Ohad Ben-Cohen Subject: [PATCH V3 1/4] mmc: core: Stop bkops for eMMC only from mmc suspend Date: Tue, 16 Apr 2013 12:00:34 +0200 Message-ID: <1366106437-18004-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1366106437-18004-1-git-send-email-ulf.hansson@stericsson.com> References: <1366106437-18004-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmF5dCatBeWH53WCOWEazatfpgYg5uyZi8ybLO2rURaXAYFGxufrCQGFcjpU3GWYJubLNM7 X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson Move mmc suspend specific operations to be executed from the .suspend callback in the mmc bus_ops. This simplifies the mmc_suspend_host function which is supposed to handle nothing but common suspend tasks. Since eMMC can be considered non-removable there are no need to check for ongoing bkops at PM_SUSPEND_PREPARE notification so remove it. Signed-off-by: Ulf Hansson Cc: Maya Erez Cc: Subhash Jadavani Cc: Arnd Bergmann Cc: Kevin Liu Cc: Adrian Hunter Cc: Daniel Drake Cc: Ohad Ben-Cohen --- drivers/mmc/core/core.c | 22 +--------------------- drivers/mmc/core/mmc.c | 6 ++++++ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index ad7decc..f001097 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2631,14 +2631,8 @@ int mmc_suspend_host(struct mmc_host *host) mmc_bus_get(host); if (host->bus_ops && !host->bus_dead) { - if (host->bus_ops->suspend) { - if (mmc_card_doing_bkops(host->card)) { - err = mmc_stop_bkops(host->card); - if (err) - goto out; - } + if (host->bus_ops->suspend) err = host->bus_ops->suspend(host); - } if (err == -ENOSYS || !host->bus_ops->resume) { /* @@ -2662,10 +2656,8 @@ int mmc_suspend_host(struct mmc_host *host) if (!err && !mmc_card_keep_power(host)) mmc_power_off(host); -out: return err; } - EXPORT_SYMBOL(mmc_suspend_host); /** @@ -2720,22 +2712,10 @@ int mmc_pm_notify(struct notifier_block *notify_block, struct mmc_host *host = container_of( notify_block, struct mmc_host, pm_notify); unsigned long flags; - int err = 0; switch (mode) { case PM_HIBERNATION_PREPARE: case PM_SUSPEND_PREPARE: - if (host->card && mmc_card_mmc(host->card) && - mmc_card_doing_bkops(host->card)) { - err = mmc_stop_bkops(host->card); - if (err) { - pr_err("%s: didn't stop bkops\n", - mmc_hostname(host)); - return err; - } - mmc_card_clr_doing_bkops(host->card); - } - spin_lock_irqsave(&host->lock, flags); host->rescan_disable = 1; spin_unlock_irqrestore(&host->lock, flags); diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index d584f7c..66a530e 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1411,6 +1411,12 @@ static int mmc_suspend(struct mmc_host *host) mmc_claim_host(host); + if (mmc_card_doing_bkops(host->card)) { + err = mmc_stop_bkops(host->card); + if (err) + goto out; + } + err = mmc_cache_ctrl(host, 0); if (err) goto out;