public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] error: sdhci_send_command: Timeout for status update!
Date: Fri, 24 Jun 2016 06:56:43 +0200	[thread overview]
Message-ID: <576CBD8B.5010404@denx.de> (raw)
In-Reply-To: <CAAGaQKATED=5WCq=SPaZGs95y_NcV7PqKPny=emjN64Ezqwg8g@mail.gmail.com>

Steve,

On 24.06.2016 00:06, Steve Rae wrote:
> I am asking you about this code, because of this:
>    commit 29905a4 - mmc: sdhci: Use timer based timeout detection in
> sdhci_send_command()
>
> Occasionally, I am seeing failures when writing to flash on my device:
>
>    Flashing sparse image at offset 2078720
>    Flashing Sparse Image
>    sdhci_send_command: Timeout for status update!
>    mmc fail to send stop cmd
>    write_sparse_image: Write failed, block #2181088 [0]
>
> I can eliminate this error if I kludge the following code:
>
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 5c71ab8..854f7ce 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -243,9 +243,9 @@ static int sdhci_send_command(struct mmc *mmc,
> struct mmc_cmd *cmd,
>                  if (stat & SDHCI_INT_ERROR)
>                          break;
>          } while (((stat & mask) != mask) &&
> -                (get_timer(start) < CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT));
> +                (get_timer(start) < 600 /*CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT*/));
>
> -       if (get_timer(start) >= CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT) {
> +       if (get_timer(start) >= 600 /*CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT*/) {
>                  if (host->quirks & SDHCI_QUIRK_BROKEN_R1B)
>                          return 0;
>                  else {
>
> I don't know much about this - I arrived at 600 by trial and error
> (500 fails...)
> Any ideas?

Perhaps your platform needs a bigger timeout value. Did you check
what the Linux driver does here? You could move
CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT to Kconfig with a default of 100
and select a higher value for your platform.

Thanks,
Stefan

  reply	other threads:[~2016-06-24  4:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23 22:06 [U-Boot] error: sdhci_send_command: Timeout for status update! Steve Rae
2016-06-24  4:56 ` Stefan Roese [this message]
2016-06-24 17:09   ` Steve Rae
2016-06-24 13:48 ` Masahiro Yamada

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=576CBD8B.5010404@denx.de \
    --to=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /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