From: Seungwon Jeon <tgih.jun@samsung.com>
To: merez@codeaurora.org
Cc: linux-mmc@vger.kernel.org, 'Chris Ball' <cjb@laptop.org>,
linux-kernel@vger.kernel.org
Subject: RE: [PATCH v4 2/2] mmc: core: Support packed command for eMMC4.5 device
Date: Thu, 16 Feb 2012 09:09:45 +0900 [thread overview]
Message-ID: <004301ccec3f$4a4e9320$deebb960$%jun@samsung.com> (raw)
In-Reply-To: <fd4b8ef9df0d19e20c07923077937231.squirrel@www.codeaurora.org>
Maya Erez <merez@codeaurora.org> wrote:
> > @@ -1065,12 +1075,60 @@ static int mmc_blk_err_check(struct mmc_card
> > *card,
> > if (!brq->data.bytes_xfered)
> > return MMC_BLK_RETRY;
> >
> > + if (mq_mrq->packed_cmd != MMC_PACKED_NONE) {
> > + if (unlikely(brq->data.blocks << 9 != brq->data.bytes_xfered))
> > + return MMC_BLK_PARTIAL;
> > + else
> > + return MMC_BLK_SUCCESS;
> > + }
> > +
> > if (blk_rq_bytes(req) != brq->data.bytes_xfered)
> > return MMC_BLK_PARTIAL;
> >
> > return MMC_BLK_SUCCESS;
> > }
> I think it would be best to keep the request length (brq->data.blocks << 9
> or blk_rq_bytes(req)) in a variable and use it in the original if above.
> This way you can avoid doubling the exit points from the function.
In case of packed command, brq->data.blocks contains the sum of blocks for individual request.
That means blk_rq_bytes(req) doesn't represent all packed length bytes.
And "brq->data.blocks << 9" is not idential to blk_rq_bytes(req) in non-packed command.
"brq->data.blocks" is overwritten during request preparation by the following reasons.
- brq->data.blocks > card->host->max_blk_count
- disable_multi
- do_rel_wr
So "brq->data.blocks << 9" is not good choice for request length in non-packed command.
Thanks,
Seungwon Jeon
> Thanks,
> Maya Erez
> Consultant for Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-02-16 0:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 9:08 [PATCH v4 2/2] mmc: core: Support packed command for eMMC4.5 device Seungwon Jeon
2012-01-26 9:37 ` Namjae Jeon
2012-02-15 7:12 ` merez
2012-02-15 7:12 ` merez
2012-02-15 9:41 ` Seungwon Jeon
2012-02-15 9:36 ` merez
2012-02-15 9:36 ` merez
2012-02-16 0:09 ` Seungwon Jeon [this message]
2012-02-20 21:22 ` merez
2012-02-20 21:22 ` merez
2012-02-21 2:08 ` Namjae Jeon
2012-02-21 5:35 ` Seungwon Jeon
2012-02-21 19:02 ` merez
2012-02-21 19:02 ` merez
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='004301ccec3f$4a4e9320$deebb960$%jun@samsung.com' \
--to=tgih.jun@samsung.com \
--cc=cjb@laptop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=merez@codeaurora.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 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.