From: Ulf Hansson <ulf.hansson@stericsson.com>
To: Saugata Das <saugata.das@linaro.org>
Cc: Per Forlin <per.lkml@gmail.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
Girish K S <girish.shivananjappa@linaro.org>,
"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
"cjb@laptop.org" <cjb@laptop.org>,
"patches@linaro.org" <patches@linaro.org>,
"subhashj@codeaurora.org" <subhashj@codeaurora.org>
Subject: Re: [PATCH v5] MMC-4.5 Power OFF Notify Rework
Date: Fri, 15 Jun 2012 13:26:58 +0200 [thread overview]
Message-ID: <4FDB1C02.1080309@stericsson.com> (raw)
In-Reply-To: <CAKLKtzcdGevM_mA-BSkOHC3DeasOoROB3H8z-1yiHqQxhFx0yA@mail.gmail.com>
Hi Saugata,
snip.
>>>>>
>>>>> The problem in sending CMD0 without power OFF notify is possibility of
>>>>> some data loss in MMC-4.5 devices.
>>>>
>>>>
>>>> I don't see the problem here. You will be sending power OFF notify when you
>>>> can. The only difference is when you "wake" the device from sleep mode.
>>>> Instead of using CMD5, which may work is some cases and in some cases not
>>>> (without restoring ios). So using CMD0 as common way of waking up from
>>>> suspend should be fine. Unless I missed something of course. :-)
>>>>
>>>
>>> CMD0 is a reset. I expect with power OFF notify enable, the eMMC
>>> device will postpone some control information update to its internal
>>> non-volatile memory (e.g. some data structures which are kept in the
>>> controller buffers and not stored in NAND). If we do a CMD0, then the
>>> eMMC device will be reset and we may lose some data. In addition to
>>> that, doing complete card initialization will increase the wakeup time
>>> (for 4.4 devices).
When doing poweroff_notify at suspend you have _always_ cut both vcc and
vccq, according to MMC_CAP2_POWER_OFF_VCCQ_DURING_SUSPEND, which means
you must always use CMD0 to wake up. There is no present internal cache
in the eMMC here.
In sleep mode, you can use CMD5, but until the poweroff notify patches
(the patch that broke suspend/resume, not this one), we have used CMD0
to wake up. Let's go back to that solution. Then we can address you
concern about "data loss" for sleep mode in separate patch.
>>>
>>> Till now, we have done complete card initialization during resume
>> Yes, me and Ulf think we should still do a complete initialization, at
>> least for now and in this patch.
>>
>
> In my opinion, that's incorrect on MMC-4.5 device and unoptimized for
> MMC-4.41 device.
Unoptimized for 4.41 with sleep, might be correct. But, again, let's
look into that in a second step.
As stated for 4.5 devices with poweroff_notify, there are no issues.
>
> Let me propose a new cap, MMC_CAP2_NO_INIT_ON_RESUME and do something
> like following in mmc_resume,
>
> mmc_claim_host(host);
> - if (mmc_card_is_sleep(host->card)) {
> + if (mmc_card_is_sleep(host->card)&&
> + (host->caps2& MMC_CAP2_NO_INIT_ON_RESUME)) {
> mmc_restore_ios(host,&host->saved_ios);
> err = mmc_card_awake(host);
> } else
> err = mmc_init_card(host, host->ocr, host->card);
>
> I hope it's OK for Ulf, Per, Subhash, Girish, Asutosh.
>
>
>> A separate patch may deal with resume awake CMD5 and IOS save/restore.
>>
>> We may also discuss a clean up patch later on to reduce the number of
>> bus_ops. Sleep, awake, and poweroff_notify are MMC specific.
>> power_save/power_restore maps to suspend/resume. But let's not discuss
>> this now :)
>>
>> BR
>> Per
Kind regards
Ulf Hansson
next prev parent reply other threads:[~2012-06-15 11:27 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-22 11:45 [PATCH v5] MMC-4.5 Power OFF Notify Rework Girish K S
2012-05-23 8:00 ` Subhash Jadavani
2012-05-23 11:16 ` Ulf Hansson
2012-05-28 11:03 ` Subhash Jadavani
2012-05-28 15:07 ` Saugata Das
2012-05-29 3:36 ` Girish K S
2012-06-14 13:13 ` Per Forlin
2012-06-14 13:21 ` Girish K S
2012-06-14 14:50 ` Ulf Hansson
2012-06-14 15:15 ` Saugata Das
2012-06-14 19:06 ` Per Forlin
2012-06-15 3:49 ` Saugata Das
2012-06-15 7:22 ` Ulf Hansson
2012-06-15 7:49 ` Per Forlin
2012-06-15 8:34 ` Saugata Das
2012-06-15 9:52 ` Per Forlin
2012-06-15 10:52 ` Saugata Das
2012-06-15 11:26 ` Ulf Hansson [this message]
2012-06-15 11:34 ` Saugata Das
2012-06-15 12:07 ` Ulf Hansson
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=4FDB1C02.1080309@stericsson.com \
--to=ulf.hansson@stericsson.com \
--cc=cjb@laptop.org \
--cc=girish.shivananjappa@linaro.org \
--cc=linux-mmc@vger.kernel.org \
--cc=patches@linaro.org \
--cc=per.lkml@gmail.com \
--cc=saugata.das@linaro.org \
--cc=subhashj@codeaurora.org \
--cc=ulf.hansson@linaro.org \
/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.