linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: switch voltage before sdhci_set_ios in runtime resume
@ 2015-01-29  9:42 Jisheng Zhang
  2015-01-29 10:28 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Jisheng Zhang @ 2015-01-29  9:42 UTC (permalink / raw)
  To: chris, ulf.hansson, sebastian.hesselbarth
  Cc: thomas.petazzoni, linux-mmc, linux-kernel, linux-arm-kernel,
	Jisheng Zhang

I observed the Host Control2 register isn't correctly restored
after runtime resuming on BG2Q. For example, the register reads
as 0x800c before runtime suspend, but it's set as 0x8004 after runtime
resuming. This could results in a non working host.

The reason is the Host Control2 is incorrectly reset when switching
voltage. We fix this by following the same sequence during initialization.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/mmc/host/sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c9881ca..0ad412a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2871,9 +2871,9 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
 	/* Force clock and power re-program */
 	host->pwr = 0;
 	host->clock = 0;
+	sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios);
 	sdhci_do_set_ios(host, &host->mmc->ios);
 
-	sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios);
 	if ((host_flags & SDHCI_PV_ENABLED) &&
 		!(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) {
 		spin_lock_irqsave(&host->lock, flags);
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mmc: sdhci: switch voltage before sdhci_set_ios in runtime resume
  2015-01-29  9:42 [PATCH] mmc: sdhci: switch voltage before sdhci_set_ios in runtime resume Jisheng Zhang
@ 2015-01-29 10:28 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2015-01-29 10:28 UTC (permalink / raw)
  To: Jisheng Zhang
  Cc: Chris Ball, Sebastian Hesselbarth, Thomas Petazzoni, linux-mmc,
	linux-kernel, linux-arm-kernel

On 29 January 2015 at 10:42, Jisheng Zhang <jszhang@marvell.com> wrote:
> I observed the Host Control2 register isn't correctly restored
> after runtime resuming on BG2Q. For example, the register reads
> as 0x800c before runtime suspend, but it's set as 0x8004 after runtime
> resuming. This could results in a non working host.
>
> The reason is the Host Control2 is incorrectly reset when switching
> voltage. We fix this by following the same sequence during initialization.
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>

Thanks! Applied for next.

Kind regards
Uffe

> ---
>  drivers/mmc/host/sdhci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index c9881ca..0ad412a 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -2871,9 +2871,9 @@ int sdhci_runtime_resume_host(struct sdhci_host *host)
>         /* Force clock and power re-program */
>         host->pwr = 0;
>         host->clock = 0;
> +       sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios);
>         sdhci_do_set_ios(host, &host->mmc->ios);
>
> -       sdhci_do_start_signal_voltage_switch(host, &host->mmc->ios);
>         if ((host_flags & SDHCI_PV_ENABLED) &&
>                 !(host->quirks2 & SDHCI_QUIRK2_PRESET_VALUE_BROKEN)) {
>                 spin_lock_irqsave(&host->lock, flags);
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-29 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-29  9:42 [PATCH] mmc: sdhci: switch voltage before sdhci_set_ios in runtime resume Jisheng Zhang
2015-01-29 10:28 ` Ulf Hansson

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).