All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: reset card voltage after power off
@ 2011-03-05 13:36 Linus Walleij
  2011-03-08 19:21 ` Linus Walleij
  2011-03-10 15:40 ` Chris Ball
  0 siblings, 2 replies; 3+ messages in thread
From: Linus Walleij @ 2011-03-05 13:36 UTC (permalink / raw)
  To: linux-mmc, Chris Ball; +Cc: Lee Jones, Ulf Hansson, Linus Walleij

From: Ulf Hansson <ulf.hansson@stericsson.com>

At power off, reset OCR mask to be the highest possible voltage
supported for the current mmc host.

This solves the re-initialization during the power up sequence.
The voltage may have been decreased due to the card accepts a lower
voltage than the voltage used during the initialization sequence.
We need to reset the voltage to by the host highest possible value
since according to specification the initialization must always be
done at high voltage.

Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/core/core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 2521794..b9d39ec 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1002,6 +1002,13 @@ static void mmc_power_off(struct mmc_host *host)
 {
 	host->ios.clock = 0;
 	host->ios.vdd = 0;
+
+	/*
+	 * 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 = 1 << (fls(host->ocr_avail) - 1);
+
 	if (!mmc_host_is_spi(host)) {
 		host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
 		host->ios.chip_select = MMC_CS_DONTCARE;
-- 
1.7.3.2


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

* Re: [PATCH] mmc: reset card voltage after power off
  2011-03-05 13:36 [PATCH] mmc: reset card voltage after power off Linus Walleij
@ 2011-03-08 19:21 ` Linus Walleij
  2011-03-10 15:40 ` Chris Ball
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2011-03-08 19:21 UTC (permalink / raw)
  To: linux-mmc, Chris Ball; +Cc: Lee Jones, Ulf Hansson, Linus Walleij

2011/3/5 Linus Walleij <linus.walleij@stericsson.com>:

> From: Ulf Hansson <ulf.hansson@stericsson.com>
>
> At power off, reset OCR mask to be the highest possible voltage
> supported for the current mmc host.

Any comments on this? Can we merge it?

Yours,
Linus Walleij

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

* Re: [PATCH] mmc: reset card voltage after power off
  2011-03-05 13:36 [PATCH] mmc: reset card voltage after power off Linus Walleij
  2011-03-08 19:21 ` Linus Walleij
@ 2011-03-10 15:40 ` Chris Ball
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Ball @ 2011-03-10 15:40 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-mmc, Lee Jones, Ulf Hansson, Linus Walleij

Hi,

On Sat, Mar 05 2011, Linus Walleij wrote:
> From: Ulf Hansson <ulf.hansson@stericsson.com>
>
> At power off, reset OCR mask to be the highest possible voltage
> supported for the current mmc host.
>
> This solves the re-initialization during the power up sequence.
> The voltage may have been decreased due to the card accepts a lower
> voltage than the voltage used during the initialization sequence.
> We need to reset the voltage to by the host highest possible value
> since according to specification the initialization must always be
> done at high voltage.
>
> Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
> Signed-off-by: Ulf Hansson <ulf.hansson@stericsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mmc/core/core.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 2521794..b9d39ec 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -1002,6 +1002,13 @@ static void mmc_power_off(struct mmc_host *host)
>  {
>  	host->ios.clock = 0;
>  	host->ios.vdd = 0;
> +
> +	/*
> +	 * 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 = 1 << (fls(host->ocr_avail) - 1);
> +
>  	if (!mmc_host_is_spi(host)) {
>  		host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN;
>  		host->ios.chip_select = MMC_CS_DONTCARE;

Thanks, pushed to mmc-next for .39.

It would be good to hear more about whether you think this is a
regression, should have a stable@ tag, etc.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2011-03-10 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-05 13:36 [PATCH] mmc: reset card voltage after power off Linus Walleij
2011-03-08 19:21 ` Linus Walleij
2011-03-10 15:40 ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.