public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore
  2014-11-12  3:55 [PATCH 0/2] mmc: core: power-on sdio card correctly NeilBrown
@ 2014-11-12  3:55 ` NeilBrown
  2014-11-12  3:55 ` [PATCH 2/2] mmc: core: reset sdio card properly on resume NeilBrown
  2014-11-12  8:27 ` [PATCH 0/2] mmc: core: power-on sdio card correctly Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2014-11-12  3:55 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: GTA04 owners, linux-mmc, linux-kernel

As we are restoring power to a known card, it makes sense to use
the 'ocr' value known for the card rather than the generic one
for the host interface.
This matches the use of card->ocr passed to mmc_power_up in
mmc_sdio_runtime_resume  (just before mmc_sdio_power_restore is
called), and the value passed to mmc_sdio_init_card() a little
later in mmc_sdio_power_restore().

Suggested-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: NeilBrown <neilb@suse.de>
---
 drivers/mmc/core/sdio.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index e636d9e99e4a..3c0f07961fab 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1028,7 +1028,7 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
 
 	sdio_reset(host);
 	mmc_go_idle(host);
-	mmc_send_if_cond(host, host->ocr_avail);
+	mmc_send_if_cond(host, host->card->ocr);
 
 	ret = mmc_send_io_op_cond(host, 0, NULL);
 	if (ret)

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

* [PATCH 0/2] mmc: core: power-on sdio card correctly.
@ 2014-11-12  3:55 NeilBrown
  2014-11-12  3:55 ` [PATCH 1/2] mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore NeilBrown
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: NeilBrown @ 2014-11-12  3:55 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: GTA04 owners, linux-mmc, linux-kernel

These two patches replace my previous patch
  [PATCH 2/2] mmc: core: reset sdio card properly on resume.

The only change is to use host->card->ocr instead of
host->ocr_avail, as recommend by Ulf.

These restore my libertas  wifi device properly on system
resume.

(I'm still hoping for a reply to my other patch:
   [PATCH 1/2] mmc: core: allow a reset gpio to be configured.
)

Thanks,
NeilBrown

---

NeilBrown (2):
      mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore
      mmc: core: reset sdio card properly on resume.


 drivers/mmc/core/sdio.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--
Signature

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

* [PATCH 2/2] mmc: core: reset sdio card properly on resume.
  2014-11-12  3:55 [PATCH 0/2] mmc: core: power-on sdio card correctly NeilBrown
  2014-11-12  3:55 ` [PATCH 1/2] mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore NeilBrown
@ 2014-11-12  3:55 ` NeilBrown
  2014-11-12  8:27 ` [PATCH 0/2] mmc: core: power-on sdio card correctly Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: NeilBrown @ 2014-11-12  3:55 UTC (permalink / raw)
  To: Ulf Hansson, Chris Ball; +Cc: GTA04 owners, linux-mmc, linux-kernel

mmc_sdio_power_restore() calls
	mmc_send_if_cond(host, host->card->ocr);

	ret = mmc_send_io_op_cond(host, 0, NULL);

between mmc_go_idle() and mmc_sdio_init_card().
mmc_sdio_resume() needs to as well, else my libertas sdio wifi
device doesn't resume properly from suspend.

Signed-off-by: NeilBrown <neilb@suse.de>
---
 drivers/mmc/core/sdio.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 3c0f07961fab..da927c61bf47 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -981,8 +981,12 @@ static int mmc_sdio_resume(struct mmc_host *host)
 	if (mmc_card_is_removable(host) || !mmc_card_keep_power(host)) {
 		sdio_reset(host);
 		mmc_go_idle(host);
-		err = mmc_sdio_init_card(host, host->card->ocr, host->card,
-					mmc_card_keep_power(host));
+		mmc_send_if_cond(host, host->card->ocr);
+		err = mmc_send_io_op_cond(host, 0, NULL);
+		if (!err)
+			err = mmc_sdio_init_card(host, host->card->ocr,
+						 host->card,
+						 mmc_card_keep_power(host));
 	} else if (mmc_card_keep_power(host) && mmc_card_wake_sdio_irq(host)) {
 		/* We may have switched to 1-bit mode during suspend */
 		err = sdio_enable_4bit_bus(host->card);

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

* Re: [PATCH 0/2] mmc: core: power-on sdio card correctly.
  2014-11-12  3:55 [PATCH 0/2] mmc: core: power-on sdio card correctly NeilBrown
  2014-11-12  3:55 ` [PATCH 1/2] mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore NeilBrown
  2014-11-12  3:55 ` [PATCH 2/2] mmc: core: reset sdio card properly on resume NeilBrown
@ 2014-11-12  8:27 ` Ulf Hansson
  2 siblings, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-11-12  8:27 UTC (permalink / raw)
  To: NeilBrown
  Cc: Chris Ball, GTA04 owners, linux-mmc, linux-kernel@vger.kernel.org

On 12 November 2014 04:55, NeilBrown <neilb@suse.de> wrote:
> These two patches replace my previous patch
>   [PATCH 2/2] mmc: core: reset sdio card properly on resume.
>
> The only change is to use host->card->ocr instead of
> host->ocr_avail, as recommend by Ulf.
>
> These restore my libertas  wifi device properly on system
> resume.
>
> (I'm still hoping for a reply to my other patch:
>    [PATCH 1/2] mmc: core: allow a reset gpio to be configured.

Working on a reply. Get back to you soon. :-)

> )
>
> Thanks,
> NeilBrown
>
> ---
>
> NeilBrown (2):
>       mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore
>       mmc: core: reset sdio card properly on resume.

Thanks! Applied for next!

Kind regards
Uffe

>
>
>  drivers/mmc/core/sdio.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> --
> Signature
>

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

end of thread, other threads:[~2014-11-12  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  3:55 [PATCH 0/2] mmc: core: power-on sdio card correctly NeilBrown
2014-11-12  3:55 ` [PATCH 1/2] mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore NeilBrown
2014-11-12  3:55 ` [PATCH 2/2] mmc: core: reset sdio card properly on resume NeilBrown
2014-11-12  8:27 ` [PATCH 0/2] mmc: core: power-on sdio card correctly Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox