public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arik Nemtsov <arik@wizery.com>
Cc: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>
Subject: Re: [PATCH] mmc: core: claim host during mmc_power_off on suspend
Date: Tue, 17 Jan 2012 09:18:46 +0200	[thread overview]
Message-ID: <4F1520D6.6070703@intel.com> (raw)
In-Reply-To: <1326293468-18604-1-git-send-email-arik@wizery.com>

On 11/01/12 16:51, Arik Nemtsov wrote:
> Make sure the host is claimed in all calls of mmc_power_off() during
> suspend. In addition make sure mmc_power_off() isn't called twice in
> some suspend flows.
> 
> Signed-off-by: Arik Nemtsov <arik@wizery.com>
> Signed-off-by: Ido Yariv <ido@wizery.com>
> ---
>  drivers/mmc/core/core.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 950b97d..d830c5c 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -2305,6 +2305,7 @@ EXPORT_SYMBOL(mmc_cache_ctrl);
>  int mmc_suspend_host(struct mmc_host *host)
>  {
>  	int err = 0;
> +	bool powered_off = false;
>  
>  	if (host->caps & MMC_CAP_DISABLE)
>  		cancel_delayed_work(&host->disable);
> @@ -2348,6 +2349,7 @@ int mmc_suspend_host(struct mmc_host *host)
>  				mmc_release_host(host);
>  				host->pm_flags = 0;
>  				err = 0;
> +				powered_off = true;
>  			}
>  		} else {
>  			err = -EBUSY;
> @@ -2355,8 +2357,11 @@ int mmc_suspend_host(struct mmc_host *host)
>  	}
>  	mmc_bus_put(host);
>  
> -	if (!err && !mmc_card_keep_power(host))
> +	if (!powered_off && !err && !mmc_card_keep_power(host)) {
> +		mmc_claim_host(host);

Why not mmc_try_claim_host() etc?

>  		mmc_power_off(host);
> +		mmc_release_host(host);
> +	}
>  
>  out:
>  	return err;


  parent reply	other threads:[~2012-01-17  7:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 14:51 [PATCH] mmc: core: claim host during mmc_power_off on suspend Arik Nemtsov
2012-01-16 19:17 ` Arik Nemtsov
2012-01-17  7:18 ` Adrian Hunter [this message]
2012-01-18 13:22   ` Arik Nemtsov

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=4F1520D6.6070703@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=arik@wizery.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    /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