linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Ball <cjb@laptop.org>
To: Venkatraman S <svenkatr@ti.com>
Cc: linux-mmc@vger.kernel.org
Subject: Re: [PATCH v2] mmc: core: Fix the HPI execution sequence
Date: Thu, 19 Apr 2012 09:35:01 -0400	[thread overview]
Message-ID: <87vckvkfp6.fsf@laptop.org> (raw)
In-Reply-To: <1334810595-20316-1-git-send-email-svenkatr@ti.com> (Venkatraman S.'s message of "Thu, 19 Apr 2012 10:13:15 +0530")

Hi,

On Thu, Apr 19 2012, Venkatraman S wrote:
> mmc_execute_hpi should send the HPI command only
> once, only if the card is in PRG state.
>
> According to eMMC spec, the command's completion time is
> not dependent on OUT_OF_INTERRUPT_TIME. Only the transition
> out of PRG STATE is guarded by OUT_OF_INTERRUPT_TIME - which is
> defined to begin at the end of sending the command itself.
>
> Specify the default timeout for the actual sending of HPI
> command, and then use OUT_OF_INTERRUPT_TIME to wait for
> the transition out of PRG state.
>
> Reported-by: Alex Lemberg <Alex.Lemberg@sandisk.com>
> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> ---
> 	v1->v2:	Fix formatting inside debug prints
>  drivers/mmc/core/core.c    |   44 ++++++++++++++++++++++++--------------------
>  drivers/mmc/core/mmc_ops.c |    1 -
>  2 files changed, 24 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index e541efb..d57c8f3 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -403,6 +403,7 @@ int mmc_interrupt_hpi(struct mmc_card *card)
>  {
>  	int err;
>  	u32 status;
> +	unsigned long starttime;
>  
>  	BUG_ON(!card);
>  
> @@ -421,27 +422,30 @@ int mmc_interrupt_hpi(struct mmc_card *card)
>  	/*
>  	 * If the card status is in PRG-state, we can send the HPI command.
>  	 */
> -	if (R1_CURRENT_STATE(status) == R1_STATE_PRG) {
> -		do {
> -			/*
> -			 * We don't know when the HPI command will finish
> -			 * processing, so we need to resend HPI until out
> -			 * of prg-state, and keep checking the card status
> -			 * with SEND_STATUS.  If a timeout error occurs when
> -			 * sending the HPI command, we are already out of
> -			 * prg-state.
> -			 */
> -			err = mmc_send_hpi_cmd(card, &status);
> -			if (err)
> -				pr_debug("%s: abort HPI (%d error)\n",
> -					 mmc_hostname(card->host), err);
> +	if (R1_CURRENT_STATE(status) != R1_STATE_PRG) {
> +		pr_debug("%s: Can't send HPI: Card state=%d\n",
> +			mmc_hostname(card->host), R1_CURRENT_STATE(status));
> +		err = -EINVAL;
> +		goto out;
> +	}
>  
> -			err = mmc_send_status(card, &status);
> -			if (err)
> -				break;
> -		} while (R1_CURRENT_STATE(status) == R1_STATE_PRG);
> -	} else
> -		pr_debug("%s: Left prg-state\n", mmc_hostname(card->host));
> +	starttime = jiffies;
> +	err = mmc_send_hpi_cmd(card, &status);
> +	if (err) {
> +		pr_debug("%s:HPI could not be sent. err=%d\n",

You're still missing a space in "%s: HPI".

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

  reply	other threads:[~2012-04-19 13:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 13:45 [PATCH v2] mmc: core: Fix the HPI execution sequence Venkatraman S
2012-04-18  0:20 ` Namjae Jeon
2012-04-18  1:40   ` Jaehoon Chung
2012-04-18  4:45     ` Namjae Jeon
2012-04-18  6:20       ` S, Venkatraman
2012-04-18  8:23         ` Namjae Jeon
2012-04-18  8:42           ` S, Venkatraman
2012-04-18 12:54             ` Jaehoon Chung
2012-04-18 14:49               ` S, Venkatraman
2012-04-18 14:45 ` [PATCH] " Venkatraman S
2012-04-18 23:03   ` Namjae Jeon
2012-04-19  1:52   ` Jaehoon Chung
2012-04-19  4:22     ` S, Venkatraman
2012-04-19  4:25   ` Chris Ball
2012-04-19  4:43   ` [PATCH v2] " Venkatraman S
2012-04-19 13:35     ` Chris Ball [this message]
2012-04-19 13:43       ` S, Venkatraman
2012-04-19 14:38     ` Venkatraman S
2012-05-09 13:17 ` kdorfman
2012-05-09 13:53   ` S, Venkatraman
2012-05-09 14:06     ` kdorfman
2012-05-09 14:12       ` S, Venkatraman
2012-05-10 15:08         ` kdorfman

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=87vckvkfp6.fsf@laptop.org \
    --to=cjb@laptop.org \
    --cc=linux-mmc@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).