public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: merez@codeaurora.org
To: Seungwon Jeon <tgih.jun@samsung.com>
Cc: "'S, Venkatraman'" <svenkatr@ti.com>,
	linux-mmc@vger.kernel.org, 'Chris Ball' <cjb@laptop.org>,
	linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
	kgene.kim@samsung.com, dh.han@samsung.com
Subject: RE: [PATCH 2/2] mmc: core: Support packed command for eMMC4.5       device
Date: Sun, 27 Nov 2011 11:41:11 -0800 (PST)	[thread overview]
Message-ID: <aad7cb35699550e89526a5fb083c520d.squirrel@www.codeaurora.org> (raw)

>> >> On Wed, Nov 2, 2011 at 1:33 PM, Seungwon Jeon <tgih.jun@samsung.com>
>> wrote:
>> >> > @@ -943,7 +950,8 @@ static int mmc_blk_err_check(struct mmc_card
>> *card,
>> >> >         * kind.  If it was a write, we may have transitioned to  
      * program mode, which we have to wait for it to complete.  
      */
>> >> > -       if (!mmc_host_is_spi(card->host) && rq_data_dir(req) !=
>> READ) {
>> >> > +       if ((!mmc_host_is_spi(card->host) && rq_data_dir(req) !=
>> READ) ||
>> >> > +                       (mq_mrq->packed_cmd == MMC_PACKED_WR_HDR))
Since the header's direction is WRITE I don't think we also need to check
if mq_mrq->packed_cmd == MMC_PACKED_WR_HDR since it will be covered by the
original condition.
>> {
>> >> >                u32 status;
>> >> >                do {
>> >> >                        int err = get_card_status(card, &status,
5);
A general question, not related specifically to packed commands - Do you
know why the status is not checked to see which error we got?
>> >> > @@ -980,12 +988,67 @@ 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;
>> >> >  }
>> >> >
>> >> > +static int mmc_blk_packed_err_check(struct mmc_card *card, +    
                       struct mmc_async_req *areq)
>> >> > +{
>> >> > +       struct mmc_queue_req *mq_mrq = container_of(areq, struct
>> mmc_queue_req,
>> >> > +                                                   mmc_active); +
      int err, check, status;
>> >> > +       u8 ext_csd[512];
>> >> > +
>> >> > +       check = mmc_blk_err_check(card, areq);
>> >> > +
>> >> > +       if (check == MMC_BLK_SUCCESS)
>> >> > +               return check;
I think we need to check the status for all cases and not only in case of
MMC_BLK_PARTIAL. For example, in cases where the header was traferred
successfully but had logic errors (wrong number of sectors etc.)
mmc_blk_err_check will return MMC_BLK_SUCCESS although the packed commands
failed.
>> >> > +
>> >> > +       if (check == MMC_BLK_PARTIAL) {
>> >> > +               err = get_card_status(card, &status, 0);
>> >> > +               if (err)
>> >> > +                       return MMC_BLK_ABORT;
>> >> > +
>> >> > +               if (status & R1_EXP_EVENT) {
>> >> > +                       err = mmc_send_ext_csd(card, ext_csd); +  
                    if (err)
>> >> > +                               return MMC_BLK_ABORT;
>> >> > +
>> >> > +                       if ((ext_csd[EXT_CSD_EXP_EVENTS_STATUS +
0]
why do we need the + 0?
>> &
>> >> > +                                              
>> EXT_CSD_PACKED_INDEXED_ERROR) {
>> >> > +                                       /* Make be 0-based */
The comment is not understood
>> >> > +                                       mq_mrq->packed_fail_idx =
+                                              
Thanks,
Maya Erez
--
Seny by a Consultant for Qualcomm innovation center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum

             reply	other threads:[~2011-11-27 19:41 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-27 19:41 merez [this message]
2011-11-28  8:52 ` [PATCH 2/2] mmc: core: Support packed command for eMMC4.5 device Seungwon Jeon
2011-12-01 13:51   ` merez
2011-12-02  9:06     ` Seungwon Jeon
  -- strict thread matches above, loose matches on Subject: below --
2011-11-10 13:41 merez
2011-11-11  7:26 ` Seungwon Jeon
2011-11-11  9:38   ` S, Venkatraman
2011-11-11 19:01     ` merez
2011-11-13 13:04       ` merez
2011-11-14  9:46       ` Seungwon Jeon
2011-11-15 12:48         ` merez
2011-11-17  2:02           ` Seungwon Jeon
2011-11-14  9:44     ` Seungwon Jeon
2011-11-15 13:27       ` merez
2011-11-17  2:21         ` Seungwon Jeon
2011-11-17 13:45           ` merez
2011-11-02  8:03 Seungwon Jeon
2011-11-02 10:59 ` Girish K S
2011-11-02 11:35 ` S, Venkatraman
2011-11-03  1:53   ` Seungwon Jeon
2011-11-04 14:46     ` S, Venkatraman
2011-11-07  3:45       ` Seungwon Jeon

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=aad7cb35699550e89526a5fb083c520d.squirrel@www.codeaurora.org \
    --to=merez@codeaurora.org \
    --cc=cjb@laptop.org \
    --cc=dh.han@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=svenkatr@ti.com \
    --cc=tgih.jun@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox