public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* execution order of packed command in eMMC
@ 2015-05-06 18:16 Meng Wang
  2015-05-07  7:02 ` Konstantin Dorfman
  0 siblings, 1 reply; 3+ messages in thread
From: Meng Wang @ 2015-05-06 18:16 UTC (permalink / raw)
  To: linux-mmc

Hello,

Recently, I am working on eMMC device driver. My question is on the
execution sequence of the packed commands. According to the emmc 5.0
spec,
```
6.6.32.2 Packed Commands Error Handling
If one of the individual commands causes a failure, the following
individual commands within the same packed command are not executed.
```
it seems to imply the execution of the commands in one pack is in the
sequence that they are listed in the packed command header. So when
error happens, I can safely assert it is completed for the first
PACKED_FAILURE_INDEX commands in one pack. Is my understanding
correct?

Thanks,
Meng

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: execution order of packed command in eMMC
  2015-05-06 18:16 execution order of packed command in eMMC Meng Wang
@ 2015-05-07  7:02 ` Konstantin Dorfman
  2015-05-07 14:38   ` Meng Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Dorfman @ 2015-05-07  7:02 UTC (permalink / raw)
  To: Meng Wang, linux-mmc

Hello,

On 05/06/2015 09:16 PM, Meng Wang wrote:
> sequence that they are listed in the packed command header. So when
> error happens, I can safely assert it is completed for the first
> PACKED_FAILURE_INDEX commands in one pack. Is my understanding
> correct?

Yes, mmc_blk_end_packed_req() will complete packed requests till 
idx_failure index.

 From mmc_blk_issue_rw_rq():

case MMC_BLK_PARTIAL:
			/*
			 * A block was successfully transferred.
			 */
			mmc_blk_reset_success(md, type);

			if (mmc_packed_cmd(mq_rq->cmd_type)) {
				ret = mmc_blk_end_packed_req(mq_rq);
				break;
			} else {
				ret = blk_end_request(req, 0,
						brq->data.bytes_xfered);
			}

Then, reminder will be re-issued with mmc_start_req():

...
		if (ret) {
			if (mmc_packed_cmd(mq_rq->cmd_type)) {
				if (!mq_rq->packed->retries)
					goto cmd_abort;
				mmc_blk_packed_hdr_wrq_prep(mq_rq, card, mq);
				mmc_start_req(card->host,
					      &mq_rq->mmc_active, NULL);


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: execution order of packed command in eMMC
  2015-05-07  7:02 ` Konstantin Dorfman
@ 2015-05-07 14:38   ` Meng Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Meng Wang @ 2015-05-07 14:38 UTC (permalink / raw)
  To: Konstantin Dorfman; +Cc: linux-mmc

On Thu, May 7, 2015 at 3:02 AM, Konstantin Dorfman
<kdorfman@codeaurora.org> wrote:
> Hello,
>
> On 05/06/2015 09:16 PM, Meng Wang wrote:
>>
>> sequence that they are listed in the packed command header. So when
>> error happens, I can safely assert it is completed for the first
>> PACKED_FAILURE_INDEX commands in one pack. Is my understanding
>> correct?
>
>
> Yes, mmc_blk_end_packed_req() will complete packed requests till idx_failure
> index.
>
> From mmc_blk_issue_rw_rq():
>
> case MMC_BLK_PARTIAL:
>                         /*
>                          * A block was successfully transferred.
>                          */
>                         mmc_blk_reset_success(md, type);
>
>                         if (mmc_packed_cmd(mq_rq->cmd_type)) {
>                                 ret = mmc_blk_end_packed_req(mq_rq);
>                                 break;
>                         } else {
>                                 ret = blk_end_request(req, 0,
>                                                 brq->data.bytes_xfered);
>                         }
>
> Then, reminder will be re-issued with mmc_start_req():
>
> ...
>                 if (ret) {
>                         if (mmc_packed_cmd(mq_rq->cmd_type)) {
>                                 if (!mq_rq->packed->retries)
>                                         goto cmd_abort;
>                                 mmc_blk_packed_hdr_wrq_prep(mq_rq, card,
> mq);
>                                 mmc_start_req(card->host,
>                                               &mq_rq->mmc_active, NULL);
>
>
Thanks.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-07 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-06 18:16 execution order of packed command in eMMC Meng Wang
2015-05-07  7:02 ` Konstantin Dorfman
2015-05-07 14:38   ` Meng Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox