linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: dw_mmc: Increase cmd11 timeout to 500ms
@ 2015-04-03 18:13 Doug Anderson
  2015-04-03 18:13 ` [PATCH 2/3] mmc: dw_mmc: Add a return in an unexpected cmd11 timeout Doug Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Doug Anderson @ 2015-04-03 18:13 UTC (permalink / raw)
  To: Jaehoon Chung, Seungwon Jeon, Ulf Hansson
  Cc: Alim Akhtar, Sonny Rao, Andrew Bresticker, Heiko Stuebner,
	Addy Ke, Alexandru Stan, javier.martinez, linux-rockchip,
	Doug Anderson, linux-mmc, linux-kernel

The Designware databook claims that cmd11 should be finished in 2ms,
but my testing showed that not to be the case in some situations.
I've seen cmd11 timeouts of up to 130ms (!) during reboot tests.
Let's bump the timeout way up so that we're absolutely sure.  CMD11 is
only sent during card insertion, so this extra timeout shouldn't be
terrible.

Fixes: 5c935165da79 ("mmc: dw_mmc: Add a timeout for sending CMD11")
Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 drivers/mmc/host/dw_mmc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 3883fe6..339a929 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1023,11 +1023,13 @@ static void __dw_mci_start_request(struct dw_mci *host,
 
 	if (cmd->opcode == SD_SWITCH_VOLTAGE) {
 		/*
-		 * Databook says to fail after 2ms w/ no response; give an
-		 * extra jiffy just in case we're about to roll over.
+		 * Databook says to fail after 2ms w/ no response, but evidence
+		 * shows that sometimes the cmd11 interrupt takes over 130ms.
+		 * We'll set to 500ms, plus an extra jiffy just in case jiffies
+		 * is just about to roll over.
 		 */
 		mod_timer(&host->cmd11_timer,
-			  jiffies + msecs_to_jiffies(2) + 1);
+			  jiffies + msecs_to_jiffies(500) + 1);
 	}
 
 	if (mrq->stop)
-- 
2.2.0.rc0.207.ga3a616c


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-07  2:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-03 18:13 [PATCH 1/3] mmc: dw_mmc: Increase cmd11 timeout to 500ms Doug Anderson
2015-04-03 18:13 ` [PATCH 2/3] mmc: dw_mmc: Add a return in an unexpected cmd11 timeout Doug Anderson
2015-04-03 18:13 ` [PATCH 3/3] mmc: dw_mmc: Add locking around cmd11 timer Doug Anderson
2015-04-06 10:46 ` [PATCH 1/3] mmc: dw_mmc: Increase cmd11 timeout to 500ms Jaehoon Chung
2015-04-06 19:32   ` Doug Anderson
2015-04-07  2:00     ` Jaehoon Chung

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).