MMC: CORE: eMMC in Sleep mode before suspend
Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption.
--- drivers/mmc/core/mmc.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/mmc/core/mmc.c +6 -2
@@ -900,16 +900,20 @@ static void mmc_detect(struct mmc_host *host)*/ static int mmc_suspend (struct mmc_host *host) { +int err =0 ; +BUG_ON (!host);BUG_ON (!host->card);mmc_claim_host (host); -if (!mmc_host_is_spi (host)) +if (mmc_card_can_sleep (host)) + err =mmc_card_sleep (host); +else if (!mmc_host_is_spi (host))mmc_deselect_cards (host); host->card->state &= ~MMC_STATE_HIGHSPEED ;mmc_release_host (host); -return 0 ; +return err; }/*
Signature · 1 line
1.7.0.4
Balaji,
Tried this patch along with disabling the eMMC VCC supply in suspend and it works !!! Without this patch, if I disabled the VCC supply then after resume I/O errors are seen. This change also complies with eMMC spec so am ok with this change.
Regards,
Subhash
Signature · 2 lines
Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
Quoted 50 lines
-----Original Message-----
From: [email protected] [mailto:linux-mmc- [email protected]] On Behalf Of Balaji T K
Sent: Wednesday, July 13, 2011 8:06 PM
To: [email protected]
Cc: Balaji T K
Subject: [RFC/RFT] MMC: CORE: eMMC in Sleep mode before suspendPut MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption.
Signed-off-by Balaji T K <[email protected]>--- drivers/mmc/core/mmc.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)drivers/mmc/core/mmc.c +6
-3@@ -900,16 +900,20 @@ static void mmc_detect(struct mmc_host *host)*/ static int mmc_suspend (struct mmc_host *host) { +int err =0 ; +BUG_ON (!host);BUG_ON (!host->card);mmc_claim_host (host); -if (!mmc_host_is_spi (host)) +if (mmc_card_can_sleep (host)) + err =mmc_card_sleep (host); +else if (!mmc_host_is_spi (host))mmc_deselect_cards (host); host->card->state &= ~MMC_STATE_HIGHSPEED ;mmc_release_host (host); -return 0 ; +return err; }/* -- 1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
S, Venkatraman
Acked-byQuoted 36 lines · Balaji T K
Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption.
Signed-off-by Balaji T K <[email protected]>---
drivers/mmc/core/mmc.c | 8 ++++++--1 files changed, 6 insertions(+), 2 deletions(-)drivers/mmc/core/mmc.c +6
-3@@ -900,16 +900,20 @@ static void mmc_detect(struct mmc_host *host)*/ static int mmc_suspend(struct mmc_host *host) { + int err = 0; + BUG_ON(!host); BUG_ON(!host->card); mmc_claim_host(host); - if (!mmc_host_is_spi(host)) + if (mmc_card_can_sleep(host)) + err = mmc_card_sleep(host); + else if (!mmc_host_is_spi(host)) mmc_deselect_cards(host); host->card->state &= ~MMC_STATE_HIGHSPEED; mmc_release_host(host); - return 0; + return err; } /* --
Quoted 2 lines
1.7.0.4
Balaji,
Would you mind reposting the patch without the RFC and s/CORE/core
in subject line ?
You can add my
Hi,
Quoted 11 lines · Venkatraman
Quoted 4 lines · Balaji T K
Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption.
Signed-off-by Balaji T K <[email protected]>Balaji,
Would you mind reposting the patch without the RFC and s/CORE/core
in subject line ?
You can add myAcked-by Venkatraman S <[email protected]>
No need to resend, thanks -- pushed to mmc-next with these changes and the ACK.
Anyone object to letting this soak in mmc-next for a release and merging it in 3.2? I'm worried that we'll find card or host quirks around this, and the 3.0 release is probably happening today.
- Chris.
Signature · 2 lines
Chris Ball <[email protected]> <http://printf.net/> One Laptop Per Child
Quoted 13 lines · Chris Ball
Hi,
Quoted 10 lines · Venkatraman
Quoted 4 lines · Balaji T K
Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption.
Signed-off-by Balaji T K<[email protected]>Balaji,
Would you mind reposting the patch without the RFC and s/CORE/core
in subject line ?
You can add myAcked-by Venkatraman S<[email protected]>
Quoted 6 lines
No need to resend, thanks -- pushed to mmc-next with these changes and the ACK.
Anyone object to letting this soak in mmc-next for a release and merging it in 3.2? I'm worried that we'll find card or host quirks around this, and the 3.0 release is probably happening today.
eMMC often have VccQ (logic) always on (or sharing the same power as SDRAM which comes to the same thing), but can switch off Vcc (NAND core). However, turning off Vcc without first putting the card to sleep can result in errors i.e. you are not allowed to do it.
This patch seems to be covering the "VccQ always on" case but relies on CMD0 to wake up the card.
If that is what is going on, then some comments to that effect are needed, including within mmc_init_card to note that mmc_go_idle is needed for cards that are asleep - if that is, in fact, correct.
Also, wouldn't it be nice to wake up the card with CMD5 which should be much faster than re-initialising?
Quoted 1 line
- Chris.
Quoted 31 lines · Adrian Hunter
Quoted 18 lines · Chris Ball
Hi,
Quoted 6 lines · Venkatraman
Quoted 4 lines · Balaji T K
Put MMC to sleep if it supports SLEEP/AWAKE (CMD5) in the mmc suspend to minimize power consumption.
Quoted 7 lines
Quoted 1 line
Signed-off-by Balaji T K<[email protected]>Balaji,
Would you mind reposting the patch without the RFC and s/CORE/core in subject line ?
You can add myAcked-by Venkatraman S<[email protected]>Quoted 6 lines
No need to resend, thanks -- pushed to mmc-next with these changes and the ACK.
Anyone object to letting this soak in mmc-next for a release and merging it in 3.2? I'm worried that we'll find card or host quirks around this, and the 3.0 release is probably happening today.
eMMC often have VccQ (logic) always on (or sharing the same power as SDRAM which comes to the same thing), but can switch off Vcc (NAND core). However, turning off Vcc without first putting the card to sleep can result in errors i.e. you are not allowed to do it.
Quoted 6 lines
This patch seems to be covering the "VccQ always on" case but relies on CMD0 to wake up the card.
If that is what is going on, then some comments to that effect are needed, including within
mmc_init_cardto note thatmmc_go_idleis needed for cards that are asleep - if that is, in fact, correct.
Yes, current implementation depends on CMD0 in mmc_init_card to wakeup. Specification allows eMMC card in sleep to respond to CMD0/CMD5 Will send an updated patch with comments added.
Quoted 7 lines
Also, wouldn't it be nice to wake up the card with CMD5 which should be much faster than re-initialising?
Quoted 1 line
- Chris.