mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shawn Lin <shawn.lin@rock-chips.com>
To: Alex Lemberg <Alex.Lemberg@sandisk.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: shawn.lin@rock-chips.com, Adrian Hunter <adrian.hunter@intel.com>,
	Jaehoon Chung <jh80.chung@samsung.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Doug Anderson <dianders@chromium.org>,
	"linux-rockchip@lists.infradead.org" 
	<linux-rockchip@lists.infradead.org>
Subject: Re: [PATCH] mmc: core: add auto bkops support
Date: Thu, 23 Jun 2016 09:33:24 +0800	[thread overview]
Message-ID: <23729258-7a6b-80ac-6c90-b48eed64e0ea@rock-chips.com> (raw)
In-Reply-To: <B7133967-23A7-46AF-9013-417BD282E005@sandisk.com>

在 2016/6/22 22:08, Alex Lemberg 写道:
> HI Shawn,
>
> On 6/21/16, 4:44 AM, "Shawn Lin" <shawn.lin@rock-chips.com> wrote:
>
>> On 2016/6/20 21:33, Alex Lemberg wrote:
>>> Hi Shawn,
>>>
>>> […]
>>>
>>>>>> +
>>>>>> +static int mmc_stop_auto_bkops(struct mmc_card *card)
>>>>>> +{
>>>>>> +	int err = 0;
>>>>>> +
>>>>>> +	if (!card->ext_csd.auto_bkops_en)
>>>>>> +		return 0;
>>>>>> +
>>>>>
>>>>> Shouldn’t the BKOPS_STATUS be checked prior to disabling the BKOPS activity of the device?
>>>>>
>>>>
>>>> Hrmm.. I read the whole section of spec for it, and I did find this
>>>> requirement for manul bkops but not for the auto one. So what should we
>>>> do if using the auto one?
>>>>
>>>
>>> In case of AUTO BKOPS, the eMMC Device should perform internal GC
>>> in the same way as in case of MANUAL BKOPS.
>>> The only difference is a host awareness.
>>
>> agree.
>>
>>> Although there is no requirement in the spec, I think the driver can
>>> give some time to the device to perform/complete its internal GC during the idle time.
>>> Thus I think we can check the BKOPS_STATUS on Runtime suspend.
>>
>> We shouldn't diable bkops on *runtime* suspend as it's just the right
>> time for firmware to do GC. We could consider to check and wait for
>> the status when doing poweroff, although it seems firmware should be
>> able to accept the disable cmd and deal the on-going work perfectly
>> when doing bkops without host's awareness, just the same way as suddent
>> power loss cases.
>
> If I am not wrong, in current implementation of runtime suspend,
> the driver stops BKOPS (send HPI) just before sending sleep command,
> see _mmc_suspend(), depends on “MMC_CAP_AGGRESSIVE_PM” flag.
> In this case, the eMMC device will not have enough time to perform internal
> BKOPS in both – Manual and Auto BKOPS configurations.
>

ye, so it seems a pre-exiting issue before introducing auto bkops?
I think we can push another patch to improve it but not handling
it for this $SUBJECT, does it sound ok to you?

> For the poweroff, it should be OK with a current implementation of
> PON (mmc_poweroff_notify())
>
>>
>> Also I don't know whether the firmware will reflect its status on
>> BKOPS_STATUS or not when enabling the auto one. I will do more test.
>>
>> Anyway, thanks for sharing your thought.
>> Also Adrian point out that currently we trigger manual bkosp from
>> userspace via mmc-utils, and I agreed we shouldn't force kernel stack
>> to enable it defaultly. So I'm prone not to update this $SUBJECT and
>> migrate it to mmc-utils later.
>>
>>>
>>> […]
>>>
>>> Thanks,
>>> Alex
>>>
>>
>>
>> --
>> Best Regards
>> Shawn Lin
>>
>


-- 
Best Regards
Shawn Lin

  reply	other threads:[~2016-06-23  1:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06  3:07 Shawn Lin
2016-06-08 14:46 ` Alex Lemberg
2016-06-12  1:13   ` Shawn Lin
2016-06-20 13:33     ` Alex Lemberg
2016-06-21  0:38       ` Jaehoon Chung
2016-06-21  1:44       ` Shawn Lin
2016-06-22 14:08         ` Alex Lemberg
2016-06-23  1:33           ` Shawn Lin [this message]
2016-06-23  5:22             ` Adrian Hunter
2016-06-27  9:08               ` Ulf Hansson
2016-06-27 11:30                 ` Alex Lemberg
2016-06-13  6:29 ` Adrian Hunter
2016-06-13  7:48   ` Shawn Lin
2016-06-13  8:17     ` Adrian Hunter
2016-06-13  8:58       ` Shawn Lin
2016-06-13 12:25         ` Adrian Hunter
2016-06-22 10:21           ` Ulf Hansson
2016-06-22 14:20             ` Alex Lemberg
2016-06-22 14:28               ` Ulf Hansson
2016-06-22 14:57                 ` Alex Lemberg
2016-06-22 15:03                   ` Ulf Hansson
2016-06-23  2:08             ` Shawn Lin
2016-06-27  9:00               ` 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=23729258-7a6b-80ac-6c90-b48eed64e0ea@rock-chips.com \
    --to=shawn.lin@rock-chips.com \
    --cc=Alex.Lemberg@sandisk.com \
    --cc=adrian.hunter@intel.com \
    --cc=dianders@chromium.org \
    --cc=jh80.chung@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®