All of lore.kernel.org
 help / color / mirror / Atom feed
From: "T Krishnamoorthy, Balaji" <balajitk@ti.com>
To: Chris Ball <cjb@laptop.org>
Cc: linux-mmc@vger.kernel.org, subhashj@codeaurora.org,
	adrian.hunter@intel.com, Venkatraman S <svenkatr@ti.com>,
	Jarkko Lavinen <jarkko.lavinen@nokia.com>
Subject: Re: [PATCH v2] mmc: core: eMMC in Sleep mode before suspend
Date: Thu, 12 Apr 2012 12:52:47 +0530	[thread overview]
Message-ID: <CANrkHUbD6hP3BN0zE8W2T5kH+WzM9ZqUqTeG2YqZBFVS3bZDLw@mail.gmail.com> (raw)
In-Reply-To: <87wr5lr30z.fsf@laptop.org>

On Thu, Apr 12, 2012 at 9:54 AM, Chris Ball <cjb@laptop.org> wrote:
> Hi,
>
> On Thu, Sep 08 2011, Balaji T K wrote:
>> Put MMC to sleep if it supports SLEEP/AWAKE (CMD5)
>> in the mmc suspend so that Vcc (NAND core) can be cut
>> to minimize power consumption.
>> eMMC put into SLEEP can respond to CMD0 or H/W reset or CMD5.
>> Current implemention on resume from suspend relies on CMD0 in
>> mmc_init_card to get out of SLEEP mode.
>>
>> Signed-off-by: Balaji T K <balajitk@ti.com>
>> Acked-by: Venkatraman S <svenkatr@ti.com>
>
> I've just tried this on an eMMC 4.41 device (Sandisk SEM04G) with
> sdhci-pxav3, and it resulted in a crash on the way into suspend:
>
> [   18.379192] PM: Syncing filesystems ... done.
> [   18.423866] Freezing user space processes ... (elapsed 0.01 seconds) done.
> [   18.446542] Freezing remaining freezable tasks ... (elapsed 0.01 seconds) done.
> [   18.549586] PM: Device sdhci-pxav3.2 failed to suspend: error -110
> [   18.583808] PM: Some devices failed to suspend
> [   22.141284] mmcblk0: error -110 sending status command, retrying
> [   22.153150] mmcblk0: error -110 sending status command, retrying
> [   22.164708] mmcblk0: error -110 sending status command, aborting
> [   22.176097] end_request: I/O error, dev mmcblk0, sector 4430104
> [..]
>
> Digging down, the -110 is coming from:
>
> int mmc_card_sleepawake(struct mmc_host *host, int sleep)
> {
>        struct mmc_command cmd = {0};
>        struct mmc_card *card = host->card;
>        int err;
>
>        if (sleep)
>                mmc_deselect_cards(host);
>
>        cmd.opcode = MMC_SLEEP_AWAKE;
>        cmd.arg = card->rca << 16;
>        if (sleep)
>                cmd.arg |= 1 << 15;
>
>        cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
>        err = mmc_wait_for_cmd(host, &cmd, 0);
>        if (err)
>                return err;
>        [..]
>
> Has anyone tried sleepawake on an SEM04G before?
>
Hi Chris,

I tried eMMC 4.41 device (Sandisk SEM08G) with
omap4, both CMD5 sleep/awake is successful

mmc_card_sleepawake (host, 1)
[   20.094451] mmc0: starting CMD7 arg 00000000 flags 00000000
[   20.103576] omap_hsmmc omap_hsmmc.1: mmc0: CMD7, argument 0x00000000
[   20.103576] omap_hsmmc omap_hsmmc.1: IRQ Status is 1
[   20.110229] mmc0: req done (CMD7): 0: 00000000 00000000 00000000 00000000
[   20.122528] mmc0: starting CMD5 arg 00018000 flags 0000001d
[   20.128356] omap_hsmmc omap_hsmmc.1: mmc0: CMD5, argument 0x00018000
[   20.135040] omap_hsmmc omap_hsmmc.1: IRQ Status is 1
[   20.140228] omap_hsmmc omap_hsmmc.1: IRQ Status is 2
[   20.140228] mmc0: req done (CMD5): 0: 00000600 00000000 00000000 00000000
[   20.152526] mmc0: clock 0Hz busmode 1 powermode 0 cs 0 Vdd 0 width 0 timing 0

mmc_card_sleepawake (host, 0)
[   32.875762] mmc0: starting CMD5 arg 00010000 flags 0000001d
[   32.881591] omap_hsmmc omap_hsmmc.1: mmc0: CMD5, argument 0x00010000
[   32.888549] omap_hsmmc omap_hsmmc.1: IRQ Status is 1
[   32.893737] omap_hsmmc omap_hsmmc.1: IRQ Status is 2
[   32.898925] mmc0: req done (CMD5): 0: 00001400 00000000 00000000 00000000
[   32.906066] mmc0: starting CMD7 arg 00010000 flags 00000015
[   32.911895] omap_hsmmc omap_hsmmc.1: mmc0: CMD7, argument 0x00010000
[   32.918884] omap_hsmmc omap_hsmmc.1: IRQ Status is 1
[   32.918884] mmc0: req done (CMD7): 0: 00000700 00000000 00000000 00000000
[   32.931182] omap_hsmmc omap_hsmmc.1: disabled

> It seems likely (I haven't tested yet, but will do) that the card
> actually went into sleep successfully and is waiting for an AWAKE
> command, even though mmc_wait_for_cmd() returned a timeout.
> If so, any suggestions on how to handle that case?
>
> Thanks,
>
> - Chris.
> --
> Chris Ball   <cjb@laptop.org>   <http://printf.net/>
> One Laptop Per Child

      reply	other threads:[~2012-04-12  7:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 16:38 [PATCH v2] mmc: core: eMMC in Sleep mode before suspend Balaji T K
2011-09-09  6:34 ` Subhash Jadavani
2011-09-09  6:56   ` Adrian Hunter
2011-09-21 17:47 ` Chris Ball
2012-04-12  4:24 ` Chris Ball
2012-04-12  7:22   ` T Krishnamoorthy, Balaji [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANrkHUbD6hP3BN0zE8W2T5kH+WzM9ZqUqTeG2YqZBFVS3bZDLw@mail.gmail.com \
    --to=balajitk@ti.com \
    --cc=adrian.hunter@intel.com \
    --cc=cjb@laptop.org \
    --cc=jarkko.lavinen@nokia.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=subhashj@codeaurora.org \
    --cc=svenkatr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.