All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] mmc: dw_mmc: Zap endless timeout
Date: Fri, 11 Sep 2015 13:49:56 +0200	[thread overview]
Message-ID: <201509111349.57023.marex@denx.de> (raw)
In-Reply-To: <1441958371.2737.19.camel@synopsys.com>

On Friday, September 11, 2015 at 09:59:32 AM, Alexey Brodkin wrote:
> Hi Marek,

Hi!

> On Mon, 2015-07-27 at 22:39 +-0200, Marek Vasut wrote:
> +AD4- Endless timeouts are bad, since if we get stuck in one, we have no
> +AD4- way out. Zap this one by implementing proper timeout.
> +AD4-
> +AD4- Signed-off-by: Marek Vasut +ADw-marex+AEA-denx.de+AD4-
> +AD4- Cc: Dinh Nguyen +ADw-dinguyen+AEA-opensource.altera.com+AD4-
> +AD4- Cc: Pantelis Antoniou +ADw-panto+AEA-antoniou-consulting.com+AD4-
> +AD4- Cc: Tom Rini +ADw-trini+AEA-konsulko.com+AD4-
> +AD4- ---
> +AD4-  drivers/mmc/dw+AF8-mmc.c +AHw- 19
> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+--- +AD4-  1 file changed, 17
> insertions(+-), 2 deletions(-)
> +AD4-
> +AD4- diff --git a/drivers/mmc/dw+AF8-mmc.c b/drivers/mmc/dw+AF8-mmc.c
> +AD4- index 3fffa71..0f61f16 100644
> +AD4- --- a/drivers/mmc/dw+AF8-mmc.c
> +AD4- +-+-+- b/drivers/mmc/dw+AF8-mmc.c
> +AD4- +AEAAQA- -211,14 +-211,29 +AEAAQA- static int
> dwmci+AF8-send+AF8-cmd(struct mmc +ACo-mmc, struct mmc+AF8-cmd +ACo-cmd,
> +AD4-  	+AH0-
> +AD4-
> +AD4-  	if (data) +AHs-
> +AD4- -		do +AHs-
> +AD4- +-		start +AD0- get+AF8-timer(0)+ADs-
> +AD4- +-		timeout +AD0- 1000+ADs-
> +AD4- +-		for (+ADsAOw-) +AHs-
> +AD4-  			mask +AD0- dwmci+AF8-readl(host, DWMCI+AF8-
RINTSTS)+ADs-
> +AD4- +-			/+ACo- Error during data transfer. +ACo-/
> +AD4-  			if (mask +ACY- (DWMCI+AF8-DATA+AF8-ERR +AHw-
> DWMCI+AF8-DATA+AF8-TOUT)) +AHs- +AD4-  				
printf(+ACIAJQ-s: DATA
> ERROR+ACEAXA-n+ACI-, +AF8AXw-func+AF8AXw-)+ADs- +AD4- 
> 				bounce+AF8-buffer+AF8-stop(+ACY-bbstate)+ADs-
> +AD4-  				return -1+ADs-
> +AD4-  			+AH0-
> +AD4- -		+AH0- while (+ACE-(mask +ACY- DWMCI+AF8-INTMSK+AF8-
DTO))+ADs-
> +AD4- +-
> +AD4- +-			/+ACo- Data arrived correctly. +ACo-/
> +AD4- +-			if (mask +ACY- DWMCI+AF8-INTMSK+AF8-DTO)
> +AD4- +-				break+ADs-
> +AD4- +-
> +AD4- +-			/+ACo- Check for timeout. +ACo-/
> +AD4- +-			if (get+AF8-timer(start) +AD4- timeout) +AHs-
> +AD4- +-				printf(+ACIAJQ-s: Timeout waiting for 
data+ACEAXA-n+ACI-,
> +AD4- +-				       +AF8AXw-func+AF8AXw-)+ADs-
> +AD4- +-				bounce+AF8-buffer+AF8-stop(+ACY-
bbstate)+ADs-
> +AD4- +-				return TIMEOUT+ADs-
> +AD4- +-			+AH0-
> +AD4- +-		+AH0-
> +AD4-
> +AD4-  		dwmci+AF8-writel(host, DWMCI+AF8-RINTSTS, mask)+ADs-
> +AD4-

btw Is your mailer totally broken by any chance ?

> It turned out that patch breaks functionality in some cases.
> For me on every attempt to download something significant (at least I see
> it on 5/7 Mb files) from SD I'm seeing timeout firing too early.
> 
> I added a bit of extra instrumentation to see where time is spent and why.

Check this patch:

[PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds

https://patchwork.ozlabs.org/patch/511899/

Does it fix things for you ?

[...]

  reply	other threads:[~2015-09-11 11:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 20:39 [U-Boot] [PATCH 1/4] mmc: dw_mmc: Stop bounce buffer even in case of failure Marek Vasut
2015-07-27 20:39 ` [U-Boot] [PATCH 2/4] mmc: dw_mmc: Zap endless timeout Marek Vasut
2015-08-12  7:26   ` Pantelis Antoniou
2015-09-11  7:59   ` Alexey Brodkin
2015-09-11 11:49     ` Marek Vasut [this message]
2015-09-11 17:04       ` Alexey Brodkin
2015-09-12 16:17         ` Marek Vasut
2015-07-27 20:39 ` [U-Boot] [PATCH 3/4] mmc: dw_mmc: Improve handling of data transfer failure Marek Vasut
2015-08-12  7:27   ` Pantelis Antoniou
2015-07-27 20:39 ` [U-Boot] [PATCH 4/4] mmc: dw_mmc: Probe the MMC from OF Marek Vasut
2015-08-12  7:35   ` Pantelis Antoniou
2015-08-12 20:43     ` [U-Boot] [PATCH V2 " Marek Vasut
2015-08-19 21:58       ` Marek Vasut
2015-08-19 22:55         ` Pantelis Antoniou
2015-08-19 22:57           ` Marek Vasut
2015-08-12 20:43     ` [U-Boot] [PATCH " Marek Vasut
2015-08-12  7:25 ` [U-Boot] [PATCH 1/4] mmc: dw_mmc: Stop bounce buffer even in case of failure Pantelis Antoniou

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=201509111349.57023.marex@denx.de \
    --to=marex@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.