mmc: core: power-on sdio card correctly.
cover mmc: core: power-on sdio card correctly.
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
PATCH 1/2 mmc: core: use card->ocr when negotiating voltage setting in mmc_sdio_power_restore
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().
--- drivers/mmc/core/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/core/sdio.c +1 -1
@@ -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)
PATCH 2/2 mmc: core: reset sdio card properly on resume.
In reply to NeilBrownmmc_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.
--- drivers/mmc/core/sdio.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/mmc/core/sdio.c +6 -2
@@ -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);
Ulf Hansson
AppliedQuoted 11 lines · NeilBrown
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->ocrinstead ofhost->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. :-)
Quoted 10 lines
)
Thanks,
NeilBrown---
NeilBrown (2):
mmc: core: usecard->ocrwhen negotiating voltage setting inmmc_sdio_power_restore
mmc: core: reset sdio card properly on resume.
Thanks! Applied for next!
Kind regards
Uffe
Quoted 8 lines
drivers/mmc/core/sdio.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)--
Signature