linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] mmc: core: fix HPI polling timeout
@ 2013-05-13  8:28 Konstantin Dorfman
  0 siblings, 0 replies; only message in thread
From: Konstantin Dorfman @ 2013-05-13  8:28 UTC (permalink / raw)
  To: cjb; +Cc: sthumma, linux-arm-msm, linux-mmc, merez, Konstantin Dorfman

Out of CPU time for the MMC context included into measured timeout. System
under heavy load will easily exceed out_of_int_time (typically 20 ms).
In this case real card status checked again and error reported for wrong
card state only.

Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
Signed-off-by: Sujith Reddy Thumma <sthumma@codeaurora.org>

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index c40396f..4d06ada 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -630,8 +630,11 @@ int mmc_interrupt_hpi(struct mmc_card *card)
 
 		if (!err && R1_CURRENT_STATE(status) == R1_STATE_TRAN)
 			break;
-		if (time_after(jiffies, prg_wait))
-			err = -ETIMEDOUT;
+		if (time_after(jiffies, prg_wait)) {
+			err = mmc_send_status(card, &status);
+			if (!err && R1_CURRENT_STATE(status) != R1_STATE_TRAN)
+				err = -ETIMEDOUT;
+		}
 	} while (!err);
 
 out:
-- 
1.7.6
--
Konstantin Dorfman,
QUALCOMM ISRAEL, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-05-13  8:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-13  8:28 [RFC/PATCH] mmc: core: fix HPI polling timeout Konstantin Dorfman

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