linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aaron Lu <aaron.lu@amd.com>
To: Adrian Hunter <adrian.hunter@intel.com>
Cc: Chris Ball <cjb@laptop.org>,
	linux-mmc@vger.kernel.org, Philip Rakity <prakity@marvell.com>
Subject: Re: [PATCH 2/2] mmc: sdhci: always reset all during resume
Date: Fri, 3 Feb 2012 10:02:37 +0800	[thread overview]
Message-ID: <20120203020237.GA6865@ladygaga> (raw)
In-Reply-To: <1327926439-23603-3-git-send-email-adrian.hunter@intel.com>

On Mon, Jan 30, 2012 at 02:27:19PM +0200, Adrian Hunter wrote:
> During suspend the host controller may or may not be powered off.
> In order to get the same result either way, always perform a
> software "reset all" when resuming.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Philip Rakity <prakity@marvell.com>
> Cc: Aaron Lu <aaron.lu@amd.com>

Acked-by: Aaron Lu <aaron.lu@amd.com>

> ---
>  drivers/mmc/host/sdhci.c |   29 +++++++++++------------------
>  1 files changed, 11 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 8d66706..ef2434c 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -219,31 +219,20 @@ static void sdhci_reset(struct sdhci_host *host, u8 mask)
>  	}
>  }
>  
> -static void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios);
> -
> -static void sdhci_init(struct sdhci_host *host, int soft)
> +static void sdhci_init(struct sdhci_host *host)
>  {
> -	if (soft)
> -		sdhci_reset(host, SDHCI_RESET_CMD|SDHCI_RESET_DATA);
> -	else
> -		sdhci_reset(host, SDHCI_RESET_ALL);
> +	sdhci_reset(host, SDHCI_RESET_ALL);
>  
>  	sdhci_clear_set_irqs(host, SDHCI_INT_ALL_MASK,
>  		SDHCI_INT_BUS_POWER | SDHCI_INT_DATA_END_BIT |
>  		SDHCI_INT_DATA_CRC | SDHCI_INT_DATA_TIMEOUT | SDHCI_INT_INDEX |
>  		SDHCI_INT_END_BIT | SDHCI_INT_CRC | SDHCI_INT_TIMEOUT |
>  		SDHCI_INT_DATA_END | SDHCI_INT_RESPONSE);
> -
> -	if (soft) {
> -		/* force clock reconfiguration */
> -		host->clock = 0;
> -		sdhci_set_ios(host->mmc, &host->mmc->ios);
> -	}
>  }
>  
>  static void sdhci_reinit(struct sdhci_host *host)
>  {
> -	sdhci_init(host, 0);
> +	sdhci_init(host);
>  	sdhci_enable_card_detection(host);
>  }
>  
> @@ -2423,8 +2412,12 @@ int sdhci_resume_host(struct sdhci_host *host)
>  	if (ret)
>  		return ret;
>  
> -	sdhci_init(host, (host->mmc->pm_flags & MMC_PM_KEEP_POWER));
> -	mmiowb();
> +	sdhci_init(host);
> +
> +	/* Force clock and power re-program */
> +	host->pwr = 0;
> +	host->clock = 0;
> +	sdhci_do_set_ios(host, &host->mmc->ios);
>  
>  	ret = mmc_resume_host(host->mmc);
>  	sdhci_enable_card_detection(host);
> @@ -2500,7 +2493,7 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
>  			host->ops->enable_dma(host);
>  	}
>  
> -	sdhci_init(host, 0);
> +	sdhci_init(host);
>  
>  	/* Force clock and power re-program */
>  	host->pwr = 0;
> @@ -2980,7 +2973,7 @@ int sdhci_add_host(struct sdhci_host *host)
>  		host->vmmc = NULL;
>  	}
>  
> -	sdhci_init(host, 0);
> +	sdhci_init(host);
>  
>  #ifdef CONFIG_MMC_DEBUG
>  	sdhci_dumpregs(host);
> -- 
> 1.7.6.4
> 
> 


  reply	other threads:[~2012-02-03  2:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 12:27 [PATCH 0/2] mmc: sdhci-pci: fixes for Medfield SDIO suspend / resume Adrian Hunter
2012-01-30 12:27 ` [PATCH 1/2] mmc: sdhci-pci: set Medfield SDIO as non-removable Adrian Hunter
2012-02-05  2:02   ` Chris Ball
2012-01-30 12:27 ` [PATCH 2/2] mmc: sdhci: always reset all during resume Adrian Hunter
2012-02-03  2:02   ` Aaron Lu [this message]
2012-02-05  1:09   ` Chris Ball
2012-02-05  2:09     ` Nicolas Pitre
2012-02-06 13:14     ` 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=20120203020237.GA6865@ladygaga \
    --to=aaron.lu@amd.com \
    --cc=adrian.hunter@intel.com \
    --cc=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=prakity@marvell.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;
as well as URLs for NNTP newsgroup(s).