U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] arm: mmc: increase MMC SDHCI read status timeout
Date: Tue, 28 Jun 2016 17:00:37 +0200	[thread overview]
Message-ID: <57729115.8040903@denx.de> (raw)
In-Reply-To: <1467063821-15900-1-git-send-email-steve.rae@raedomain.com>

Hi Steve,

On 27.06.2016 23:43, Steve Rae wrote:
> Otherwise,  ocassionally see errors like this:
>    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]
>
> This does not affect the actual writing speed, which is controlled by
> the default value:
>    CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT
>
> It only increases the retries when reading:
>    SDHCI_INT_STATUS
> to avoid the timeout error.
>
> Signed-off-by: Steve Rae <steve.rae@raedomain.com>
> ---
> as per the discussion in:
> http://lists.denx.de/pipermail/u-boot/2016-June/258966.html
> this supercedes:
> http://patchwork.ozlabs.org/patch/615994/

IIRC, I've suggested to move SDHCI_CMD_DEFAULT_TIMEOUT to Kconfig
and use the old value as default value. So that you can overwrite
it for your board / platform via your defconfig. But I have no
strong feelings here - your current version also works for
me and does not "clutter" the Kconfig subsystem with too many
values. So:

Reviewed-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

>   drivers/mmc/sdhci.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 5c71ab8..aa4cd4f 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -127,6 +127,7 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
>   #define CONFIG_SDHCI_CMD_MAX_TIMEOUT		3200
>   #endif
>   #define CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT	100
> +#define CONFIG_SDHCI_READ_STATUS_TIMEOUT	1000
>
>   static int sdhci_send_command(struct mmc *mmc, struct mmc_cmd *cmd,
>   		       struct mmc_data *data)
> @@ -243,9 +244,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) < CONFIG_SDHCI_READ_STATUS_TIMEOUT));
>
> -	if (get_timer(start) >= CONFIG_SDHCI_CMD_DEFAULT_TIMEOUT) {
> +	if (get_timer(start) >= CONFIG_SDHCI_READ_STATUS_TIMEOUT) {
>   		if (host->quirks & SDHCI_QUIRK_BROKEN_R1B)
>   			return 0;
>   		else {
>

Viele Gr??e,
Stefan

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de

  reply	other threads:[~2016-06-28 15:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-27 21:43 [U-Boot] [PATCH] arm: mmc: increase MMC SDHCI read status timeout Steve Rae
2016-06-28 15:00 ` Stefan Roese [this message]
2016-06-28 20:30   ` Steve Rae
2016-06-28 20:34     ` Tom Rini
2016-06-28 20:53       ` Steve Rae
2016-06-28 22:21         ` Tom Rini
2016-06-28 22:33           ` Steve Rae
2016-06-29 11:52             ` Masahiro Yamada
2016-06-29 20:30               ` Steve Rae

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=57729115.8040903@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