All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Konstantin Dorfman <kdorfman@codeaurora.org>
Cc: Jaehoon Chung <jh80.chung@samsung.com>,
	linux-mmc <linux-mmc@vger.kernel.org>,
	Chris Ball <cjb@laptop.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Hanumath Prasad <hanumath.prasad@stericsson.com>,
	Per Forlin <per.lkml@gmail.com>,
	Sebastian Rasmussen <sebras@gmail.com>,
	"Dong, Chuanxiao" <chuanxiao.dong@intel.com>,
	"svenkatr@ti.com" <svenkatr@ti.com>
Subject: Re: [PATCH v3] mmc: support BKOPS feature for eMMC
Date: Wed, 23 Nov 2011 08:54:13 +0900	[thread overview]
Message-ID: <4ECC3625.3090109@samsung.com> (raw)
In-Reply-To: <3f75bb7f25e649376784536d819e7fbf.squirrel@www.codeaurora.org>

Hi Konstantin

On 11/22/2011 09:44 PM, Konstantin Dorfman wrote:

> Hello Jaehoon,
> 
> ...
>> +/**
>> + *	mmc_start_bkops - start BKOPS for supported cards
>> + *	@card: MMC card to start BKOPS
>> + *
>> + *	Start background operations whenever requested.
>> + *	when the urgent BKOPS bit is set in a R1 command response
>> + *	then background operations should be started immediately.
>> +*/
>> +void mmc_start_bkops(struct mmc_card *card)
>> +{
>> +	int err;
>> +	unsigned long flags;
>> +
>> +	BUG_ON(!card);
>> +	if ((!card->ext_csd.bkops_en) ||
>> +			!(card->host->caps2 & MMC_CAP2_BKOPS))
>> +		return;
>> +
>> +	/*
>> +	 * If card is already doing bkops or need for
>> +	 * bkops flag is not set, then do nothing just
>> +	 * return
>> +	 */
>> +	if (mmc_card_doing_bkops(card)
>> +			|| !mmc_card_need_bkops(card))
>> +		return;
>> +
>> +	mmc_claim_host(card->host);
>> +	err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>> +			EXT_CSD_BKOPS_START, 1, 0);
>> +	if (err) {
>> +		pr_warning("error %d starting bkops\n", err);
>> +		mmc_card_clr_need_bkops(card);
>> +		goto out;
>> +	}
>> +	spin_lock_irqsave(&card->host->lock, flags);
>> +	mmc_card_clr_need_bkops(card);
>> +	mmc_card_set_doing_bkops(card);
> Sending CMD6 (by mmc_switch()) will start BKOPS on card,
> according to eMMC spec:
> -----
> 7.4.56 BKOPS_START [164]
> Writing any value to this field shall manually start background operations.
> Device shall stay busy till no more background operations are needed.
> -----
> Where/when mmc_card_clear_doing_bkops() should called? The only place I
> see this happens is
> in mmc_interrupt_bkops(). This means, that once BKOPS started, next
> read/write request
> will _always_(and not when card really busy) send HPI and only then will
> clear "doing" flag.


Right, that is called only in mmc_interrupt_bkops. I wonder how did you check
to finish the bkops without hpi command?

> May be it is possible to poll for ack from card about when BKOPS finished?
> Another possibility that
> mmc_switch() synchronous and after flow returns from it, we can clear
> "doing" flag immediately.
> Does it make sense?

i didn't know how poll for ack from card..did you know?
So i implemented that send the hpi command whatever status.

If let me know checking for ack from card, i will consider that.

Thanks

Best Regards,
Jaehoon Chung

  parent reply	other threads:[~2011-11-22 23:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-17  0:50 [PATCH v3] mmc: support BKOPS feature for eMMC Jaehoon Chung
2011-11-17 12:37 ` S, Venkatraman
2011-11-17 15:01 ` Konstantin Dorfman
2011-11-17 16:32   ` Per Forlin
2011-11-20 16:12     ` Konstantin Dorfman
2011-11-20 22:42       ` Per Forlin
2011-11-22 12:44 ` Konstantin Dorfman
2011-11-22 14:00   ` Konstantin Dorfman
2011-11-22 23:54   ` Jaehoon Chung [this message]
2011-11-28 11:33     ` Konstantin Dorfman
2011-11-29 12:20 ` Adrian Hunter
2011-11-30  4:09   ` Jaehoon Chung
2011-12-01 16:13 ` Konstantin Dorfman
2011-12-05 16:03   ` Jae hoon Chung

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=4ECC3625.3090109@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=chuanxiao.dong@intel.com \
    --cc=cjb@laptop.org \
    --cc=hanumath.prasad@stericsson.com \
    --cc=kdorfman@codeaurora.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=per.lkml@gmail.com \
    --cc=sebras@gmail.com \
    --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.