public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani <riteshh@codeaurora.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Uri Yanai <uri.yanai@sandisk.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	Alex Lemberg <alex.lemberg@sandisk.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Shawn Lin <shawn.lin@rock-chips.com>,
	Jaehoon Chung <jh80.chung@samsung.com>
Subject: Re: [PATCH v2 2/2] mmc: Checking BKOPS status prior to Suspend
Date: Fri, 3 Feb 2017 22:27:15 +0530	[thread overview]
Message-ID: <c00cb414-be2e-0f07-41e3-b9e88a0d4295@codeaurora.org> (raw)
In-Reply-To: <CAPDyKFqD00jmG=HesANpGv_=FP_cKodFkv2SdkX5DihLTbP_tA@mail.gmail.com>



On 2/3/2017 5:16 PM, Ulf Hansson wrote:
> On 3 February 2017 at 10:33, Ritesh Harjani <riteshh@codeaurora.org> wrote:
>> Hi,
>>
>> On 2/2/2017 6:19 PM, Ulf Hansson wrote:
>>>
>>> + Adrian, Shawn-Lin, Jaehoon, Ritesh
>>>
>>> On 22 January 2017 at 10:15, Uri Yanai <uri.yanai@sandisk.com> wrote:
>>>>
>>>> In case of Runtime Suspend, check the device BKOPS level.
>>>> Return –EBUSY if device need more time to complete its internal BKOPS.
>>
>> Do we need to abort the runtime suspend at all even though we are using
>> CMD5?
>>
>> From what I understood from the spec is as follows - (please correct me if I
>> am wrong) -
>> CMD7 -> CMD5 -> Busy line de-asserted by device(means autobkops execution is
>> complete) -> Enter sleep mode.
>>
>> Is the above understanding correct? In that case we may not need to abort
>> the runtime suspend right?
>> Since CMD5 completion should ensure that background operation execution is
>> complete (until then the busy line will be kept asserted).
>>
>> Opinion?
>
> Unfortunate the eMMC spec isn't crystal clear on this point. Anyway,
> my interpretation of it is not as yours. Let me elaborate on my view.
>
> In case we have enabled POWERED_ON bit (0x1) in POWER_OFF_NOTIFICATION
> register byte, during the card initialization, and we later want to
> put the device into sleep state by using CMD5. Then we need to follow
> the below sequence:
> 1) Using CMD6, write SLEEP_NOTIFICATION bits (0x4) to
> POWER_OFF_NOTIFICATION register byte.
> 2) Wait for busy! Maximum time specified in
> SLEEP_NOTIFICATION_TIME[216] (worst case 83.88s).
> 3) Put the card to sleep by send CMD5 and wait for busy (current
> implemented method of issuing sleep).
>
> As we have enabled POWERED_ON for those cards that supports
> POWER_OFF_NOTIFICATION (added in eMMC 4.5 spec), then we also need to
> follow the above sequence for when sending sleep (CMD5).
Thanks for clarifying. I initially misunderstood and missed 
SLEEP_NOTIFICATION part.
Yes, you are right, we do need to follow the above sequence you mentioned.

>
> This may become a severe problem, because the SLEEP_NOTIFICATION_TIME
> may be ridiculously long and since it immediately affects the total
> system suspend time for the platform.
Do we know more card internal details on why this time could be long?
Although POWER_OFF_SHORT time is within generic CMD6 response time.


So enabling auto bkops *may* help reduce the sleep notification time to 
some extent I guess.
Since card may already would have completed it's background operations 
while the card was idle, then sleep notification time may reduce, right?
Although, someone who have more knowledge of card internals would know 
better here.

And in case where the bkops exception level is high, patch is anyway 
aborting suspend by returning -EBUSY, giving enough time for card to 
first complete it's background operations.

>
> We need to think of something clever here to avoid a long sleep
> notification timeout from happen.
>
> [...]
>
>>>
>>> Hmm.
>>>
>>> Shouldn't we abort (return -EBUSY) also in the system PM suspend case
>>> and not only for runtime PM suspend?
>>
>>
>> My opinion - Auto bkops generally is meant for device to autonomously
>> initiate the background transfer whenever the device is idle -> in such
>> cases, we expect the device to keep it's autobkops exception level under
>> control.
>> In that case will it be good idea to abort the suspend as well?
>
> I follow your reasoning and it seems reasonable. However, see my comment below.
>
>>
>> Off-course unless we would like to cover a case where device is not idle at
>> all and during this heavy device usage suspend is getting triggered manually
>> - which gives no time for device to do auto-bkops
>> Please correct me if my understanding is wrong?
>
> This is the case that I thought off. Don't you think this could be a
> valid scenario for an Android device?
Yes, totally agree. This can be a valid use case on Android.
There can be watchdog timer monitoring per device suspend time. So, if 
we don't take care of mmc suspend case, it may result into watchdog 
bark, since mmc_suspend may take longer.

So as you mentioned, even suspend case needs to be taken care here.


>
> [...]
>
> It seems like we are discussing several related things at the same
> time. Perhaps this is the only way, as they are so closely related.
>
> Kind regards
> Uffe
>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

  reply	other threads:[~2017-02-03 16:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22  9:15 [PATCH v2 0/2] Auto BKOPS PM suspend Uri Yanai
2017-01-22  9:15 ` [PATCH v2 1/2] mmc: Adding AUTO_BKOPS_EN bit set for Auto BKOPS support Uri Yanai
2017-02-02 11:50   ` Ulf Hansson
2017-01-22  9:15 ` [PATCH v2 2/2] mmc: Checking BKOPS status prior to Suspend Uri Yanai
2017-02-02 12:49   ` Ulf Hansson
2017-02-03  9:33     ` Ritesh Harjani
2017-02-03 11:46       ` Ulf Hansson
2017-02-03 16:57         ` Ritesh Harjani [this message]
2017-02-06 11:07           ` Ulf Hansson
2017-02-05  1:43     ` Shawn Lin
2017-02-05 15:13       ` Alex Lemberg
2017-02-06  6:46         ` Shawn Lin
2017-02-06 12:20           ` Alex Lemberg
2017-02-07  1:14             ` Shawn Lin
2017-02-07  7:54               ` Ulf Hansson
2017-02-07  8:24                 ` Shawn Lin
2017-02-07 14:32                   ` Alex Lemberg
2017-02-02 11:38 ` [PATCH v2 0/2] Auto BKOPS PM suspend 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=c00cb414-be2e-0f07-41e3-b9e88a0d4295@codeaurora.org \
    --to=riteshh@codeaurora.org \
    --cc=adrian.hunter@intel.com \
    --cc=alex.lemberg@sandisk.com \
    --cc=jh80.chung@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=shawn.lin@rock-chips.com \
    --cc=ulf.hansson@linaro.org \
    --cc=uri.yanai@sandisk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox