Jaehoon Chung | 19 Jul 2012 17:12

[RESEND PATCH v10] mmc: support BKOPS feature for eMMC

Enable eMMC background operations (BKOPS) feature.

If URGENT_BKOPS is set after a response, note that BKOPS
are required. Immediately run BKOPS if required.
read/write operations should be requested during BKOPS(LEVEL-1),
then issue HPI to interrupt the ongoing BKOPS 
and service the foreground operation.
(This patch is only control the LEVEL2/3.)

If you want to enable this feature, set MMC_CAP2_BKOPS.

When repeating the writing 1GB data, at a certain time, performance is decreased.
At that time, card is also triggered the Level-3 or Level-2.
After running bkops, performance is recovered.

Future considerations
 * Check BKOPS_LEVEL=1 and start BKOPS in a preventive manner.
 * Interrupt ongoing BKOPS before powering off the card.
 * How get BKOPS_STATUS value.(periodically send ext_csd command?)
 * If use periodic bkops, also consider runtime_pm control.

Signed-off-by: Jaehoon Chung <jh80.chung <at> samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park <at> samsung.com>
Signed-off-by: Konstantin Dorfman <kdorfman <at> codeaurora.org>
Signed-off-by: Maya Erez <merez <at> codeaurora.org>
---
Changelog v10:
	- Based on latest mmc-next
	- Only control the level-2/3.
		: If triggered upper than level2, immediately start bkops.
(Continue reading)

merez | 20 Jul 2012 13:58

Re: [RESEND PATCH v10] mmc: support BKOPS feature for eMMC


On Thu, July 19, 2012 8:12 am, Jaehoon Chung wrote:
> +void mmc_start_bkops(struct mmc_card *card, bool from_exception)
> +{
> +        int err;
> +        int timeout;
> +        bool use_busy_signal;
> +
> +        BUG_ON(!card);
> +
> +        if (!card->ext_csd.bkops_en || mmc_card_doing_bkops(card) ||
> +                !(card->host->caps2 & MMC_CAP2_BKOPS))
> +                return;
To my opinion, the host cannot decide not to support BKOPs if it is
enabled by the card. In such a case, the card will expect the host to
start the BKOPs and may get into performance degradation.
I think the MMC_CAP2_BKOPS should be removed.
Does everyone agree or do I miss something?

>  <at>  <at>  -489,6 +568,53  <at>  <at>  int mmc_wait_for_cmd(struct mmc_host *host, struct
> mmc_command *cmd, int retries
>  EXPORT_SYMBOL(mmc_wait_for_cmd);
>
>  /**
> + *	mmc_stop_bkops - stop ongoing BKOPS
> + *	 <at> card: MMC card to check BKOPS
> + *
> + *	Send HPI command to stop ongoing background operations,
> + *	to allow rapid servicing of foreground operations,e.g. read/
> + *	writes. Wait until the card comes out of the programming state
(Continue reading)

Adrian Hunter | 20 Jul 2012 14:57
Picon
Favicon

Re: [RESEND PATCH v10] mmc: support BKOPS feature for eMMC

On 20/07/12 14:58, merez <at> codeaurora.org wrote:
> 
> On Thu, July 19, 2012 8:12 am, Jaehoon Chung wrote:
>> +void mmc_start_bkops(struct mmc_card *card, bool from_exception)
>> +{
>> +        int err;
>> +        int timeout;
>> +        bool use_busy_signal;
>> +
>> +        BUG_ON(!card);
>> +
>> +        if (!card->ext_csd.bkops_en || mmc_card_doing_bkops(card) ||
>> +                !(card->host->caps2 & MMC_CAP2_BKOPS))
>> +                return;
> To my opinion, the host cannot decide not to support BKOPs if it is
> enabled by the card. In such a case, the card will expect the host to
> start the BKOPs and may get into performance degradation.
> I think the MMC_CAP2_BKOPS should be removed.
> Does everyone agree or do I miss something?

I agree.  The spec says of bkops_en "Host is indicating that it shall
periodically write to BKOPS_START field to manually start
background operations."
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo <at> vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Jaehoon Chung | 23 Jul 2012 03:28

Re: [RESEND PATCH v10] mmc: support BKOPS feature for eMMC

Hi Maya,

On 07/20/2012 08:58 PM, merez <at> codeaurora.org wrote:
> 
> On Thu, July 19, 2012 8:12 am, Jaehoon Chung wrote:
>> +void mmc_start_bkops(struct mmc_card *card, bool from_exception)
>> +{
>> +        int err;
>> +        int timeout;
>> +        bool use_busy_signal;
>> +
>> +        BUG_ON(!card);
>> +
>> +        if (!card->ext_csd.bkops_en || mmc_card_doing_bkops(card) ||
>> +                !(card->host->caps2 & MMC_CAP2_BKOPS))
>> +                return;
> To my opinion, the host cannot decide not to support BKOPs if it is
> enabled by the card. In such a case, the card will expect the host to
> start the BKOPs and may get into performance degradation.
> I think the MMC_CAP2_BKOPS should be removed.
> Does everyone agree or do I miss something?
Ok..i will remove capability. I saw that other people agreed your opinion.
> 
>>  <at>  <at>  -489,6 +568,53  <at>  <at>  int mmc_wait_for_cmd(struct mmc_host *host, struct
>> mmc_command *cmd, int retries
>>  EXPORT_SYMBOL(mmc_wait_for_cmd);
>>
>>  /**
>> + *	mmc_stop_bkops - stop ongoing BKOPS
>> + *	 <at> card: MMC card to check BKOPS
(Continue reading)

merez | 23 Jul 2012 11:14

Re: [RESEND PATCH v10] mmc: support BKOPS feature for eMMC

Hi Jaehoon,

I don't have additional comments.

Thanks,
Maya
On Sun, July 22, 2012 6:28 pm, Jaehoon Chung wrote:
> Hi Maya,
>
> On 07/20/2012 08:58 PM, merez <at> codeaurora.org wrote:
>>
>> On Thu, July 19, 2012 8:12 am, Jaehoon Chung wrote:
>>> +void mmc_start_bkops(struct mmc_card *card, bool from_exception)
>>> +{
>>> +        int err;
>>> +        int timeout;
>>> +        bool use_busy_signal;
>>> +
>>> +        BUG_ON(!card);
>>> +
>>> +        if (!card->ext_csd.bkops_en || mmc_card_doing_bkops(card) ||
>>> +                !(card->host->caps2 & MMC_CAP2_BKOPS))
>>> +                return;
>> To my opinion, the host cannot decide not to support BKOPs if it is
>> enabled by the card. In such a case, the card will expect the host to
>> start the BKOPs and may get into performance degradation.
>> I think the MMC_CAP2_BKOPS should be removed.
>> Does everyone agree or do I miss something?
> Ok..i will remove capability. I saw that other people agreed your opinion.
>>
(Continue reading)


Gmane