public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Prasanna NAVARATNA <prasanna.navaratna@gmail.com>
To: linux-mmc@vger.kernel.org
Subject: Re: [PATCH] mmc: core: restore ocr and operation voltage in resume
Date: Thu, 4 Apr 2013 09:44:25 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130404T113956-355@post.gmane.org> (raw)
In-Reply-To: 1361352662-12263-1-git-send-email-kliu5@marvell.com

Kevin Liu <kliu5 <at> marvell.com> writes:

> 
> host->ocr has been reset in power off but not restored after power up
> in resume. And operation voltage will be set to the highest after resume
> back. This patch fix these two bugs.
> 
> Signed-off-by: Kevin Liu <kliu5 <at> marvell.com>
> ---
>  drivers/mmc/core/core.c  |    3 ++-
>  include/linux/mmc/host.h |    1 +
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 08a3cf2..b8c3d41 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
>  <at>  <at>  -1523,6 +1523,7  <at>  <at>  void mmc_power_off(struct 
mmc_host *host)
>  	 * Reset ocr mask to be the highest possible voltage supported for
>  	 * this mmc host. This value will be used at next power up.
>  	 */
> +	host->ocr_bak = host->ocr;
>  	host->ocr = 1 << (fls(host->ocr_avail) - 1);
> 
>  	if (!mmc_host_is_spi(host)) {
>  <at>  <at>  -2666,7 +2667,7  <at>  <at>  int mmc_resume_host(struct 
mmc_host *host)
>  	if (host->bus_ops && !host->bus_dead) {
>  		if (!mmc_card_keep_power(host)) {
>  			mmc_power_up(host);
> -			mmc_select_voltage(host, host->ocr);
> +			host->ocr = mmc_select_voltage(host, host->ocr_bak);
>  			/*
>  			 * Tell runtime PM core we just powered up the card,
>  			 * since it still believes the card is powered off.
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index d6f20cc..6e355d1 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
>  <at>  <at>  -309,6 +309,7  <at>  <at>  struct mmc_host {
> 
>  	struct mmc_ios		ios;		/* current io bus settings 
*/
>  	u32			ocr;		/* the current OCR setting 
*/
> +	u32			ocr_bak;	/* save current OCR setting 
*/
> 
>  	/* group bitfields together to minimize padding */
>  	unsigned int		use_spi_crc:1;


Hello Kevin,

Any update on this patch? 

I have seen an issue where during initialization, core will get card's ocr 
and match with host ocr available and select the appropriate voltage (3.0V)
But during suspend, maximum supported voltage from host is saved back and 
when resuming back requesting for highest voltage of host (3.3V).
It doesn't care about card's OCR.

This patch fixes it. Looks valid for me.

Thanks & Regards,
Prasanna NAVARATNA


  reply	other threads:[~2013-04-04  9:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-20  9:31 [PATCH] mmc: core: restore ocr and operation voltage in resume Kevin Liu
2013-04-04  9:44 ` Prasanna NAVARATNA [this message]
2013-04-04 10:06   ` Ulf Hansson
2013-04-04 10:43     ` Prasanna NAVARATNA
2013-04-04 11:47       ` Ulf Hansson
2013-04-04 12:26         ` Prasanna NAVARATNA
2013-04-04 14:43           ` Prasanna NAVARATNA
2013-04-04 15:37             ` Ulf Hansson
2013-04-05  6:07               ` Prasanna NAVARATNA
2013-04-05  9:39                 ` Ulf Hansson

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=loom.20130404T113956-355@post.gmane.org \
    --to=prasanna.navaratna@gmail.com \
    --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