public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Ulf Hansson <ulf.hansson@stericsson.com>
Cc: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Maya Erez <merez@codeaurora.org>,
	Subhash Jadavani <subhashj@codeaurora.org>,
	Arnd Bergmann <arnd@arndb.de>, Kevin Liu <kliu5@marvell.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Daniel Drake <dsd@laptop.org>, Ohad Ben-Cohen <ohad@wizery.com>
Subject: Re: [PATCH V3 1/4] mmc: core: Stop bkops for eMMC only from mmc suspend
Date: Thu, 18 Apr 2013 16:17:44 +0900	[thread overview]
Message-ID: <516F9E18.2020300@samsung.com> (raw)
In-Reply-To: <1366106437-18004-2-git-send-email-ulf.hansson@stericsson.com>

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

On 04/16/2013 07:00 PM, Ulf Hansson wrote:
> From: Ulf Hansson <ulf.hansson@linaro.org>
> 
> 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 <ulf.hansson@linaro.org>
> Cc: Maya Erez <merez@codeaurora.org>
> Cc: Subhash Jadavani <subhashj@codeaurora.org>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Cc: Kevin Liu <kliu5@marvell.com>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Daniel Drake <dsd@laptop.org>
> Cc: Ohad Ben-Cohen <ohad@wizery.com>
> ---
>  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;
> 


  reply	other threads:[~2013-04-18  7:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:00 [PATCH V3 0/4] mmc: Use runtime pm for blkdevice Ulf Hansson
2013-04-16 10:00 ` [PATCH V3 1/4] mmc: core: Stop bkops for eMMC only from mmc suspend Ulf Hansson
2013-04-18  7:17   ` Jaehoon Chung [this message]
2013-04-16 10:00 ` [PATCH V3 2/4] mmc: core: Add bus_ops for runtime pm callbacks Ulf Hansson
2013-04-26 13:11   ` Adrian Hunter
2013-04-29  7:54     ` Adrian Hunter
2013-04-29 13:42       ` Ulf Hansson
2013-04-16 10:00 ` [PATCH V3 3/4] mmc: block: Enable runtime pm for mmc blkdevice Ulf Hansson
2013-05-02  8:58   ` Adrian Hunter
2013-05-02  9:52     ` Ulf Hansson
2013-05-02  9:57       ` Asutosh Das
2013-05-02 11:09         ` Ulf Hansson
2013-05-02 12:22           ` Adrian Hunter
     [not found]   ` <CAMj5BkiOmh8sz-=b0z1VF9owGPX0KpbZeNfPzETemCb=C2odGQ@mail.gmail.com>
2013-05-24  8:27     ` Ulf Hansson
     [not found]       ` <CAMj5Bki+1=DSzQWYyEC1L=Pa6LpSFQKF3YvoUkkuq62wHuMWow@mail.gmail.com>
2013-05-27  7:51         ` Ulf Hansson
2013-05-27  7:52           ` Ulf Hansson
2013-05-28  6:49             ` zhangfei gao
2013-04-16 10:00 ` [PATCH V3 4/4] mmc: core: Support aggressive power management for (e)MMC/SD Ulf Hansson
2013-05-02 10:38   ` Adrian Hunter
2013-05-02 11:35     ` Ulf Hansson
2013-05-02 12:24       ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516F9E18.2020300@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=adrian.hunter@intel.com \
    --cc=arnd@arndb.de \
    --cc=cjb@laptop.org \
    --cc=dsd@laptop.org \
    --cc=kliu5@marvell.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=merez@codeaurora.org \
    --cc=ohad@wizery.com \
    --cc=subhashj@codeaurora.org \
    --cc=ulf.hansson@linaro.org \
    --cc=ulf.hansson@stericsson.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox