From patchwork Thu Jun 23 22:06:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Rae X-Patchwork-Id: 639940 X-Patchwork-Delegate: panto@antoniou-consulting.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3rbGRg6GDYz9sR8 for ; Fri, 24 Jun 2016 08:32:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 993864B853; Fri, 24 Jun 2016 00:32:10 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vATKi8599zBL; Fri, 24 Jun 2016 00:32:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8C5604B7EB; Fri, 24 Jun 2016 00:32:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BDB024B7FB for ; Fri, 24 Jun 2016 00:14:01 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3mZYVsbFhywr for ; Fri, 24 Jun 2016 00:14:01 +0200 (CEST) X-Greylist: delayed 451 seconds by postgrey-1.34 at theia; Fri, 24 Jun 2016 00:13:56 CEST X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from p3plsmtpa07-07.prod.phx3.secureserver.net (p3plsmtpa07-07.prod.phx3.secureserver.net [173.201.192.236]) by theia.denx.de (Postfix) with ESMTPS id 84DC74B77D for ; Fri, 24 Jun 2016 00:13:55 +0200 (CEST) Received: from mail-qk0-f182.google.com ([209.85.220.182]) by p3plsmtpa07-07.prod.phx3.secureserver.net with id AN6N1t0083wjCZM01N6NYP; Thu, 23 Jun 2016 15:06:23 -0700 X-Sender: smtpout@raedomain.com Received: by mail-qk0-f182.google.com with SMTP id p10so124890308qke.3 for ; Thu, 23 Jun 2016 15:06:22 -0700 (PDT) X-Gm-Message-State: ALyK8tKrsvaZeFaTvOWOFpJIm5UjPOZR6E24TMLHa8CQPzn9nPV1JqmiRpKt++4tp/14Wxvuxu/hEKHpiZW4lg== X-Received: by 10.55.147.133 with SMTP id v127mr949670qkd.109.1466719582128; Thu, 23 Jun 2016 15:06:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.55.209.77 with HTTP; Thu, 23 Jun 2016 15:06:21 -0700 (PDT) From: Steve Rae Date: Thu, 23 Jun 2016 15:06:21 -0700 X-Gmail-Original-Message-ID: Message-ID: To: Stefan Roese X-Mailman-Approved-At: Fri, 24 Jun 2016 00:32:07 +0200 Cc: u-boot@lists.denx.de Subject: [U-Boot] error: sdhci_send_command: Timeout for status update! X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Stefan, 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: else { I don't know much about this - I arrived at 600 by trial and error (500 fails...) Any ideas? Thanks, Steve steve.rae@raedomain.com (previously: srae@broadcom.com) 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;