[RFC/PATCH] mmc: core: fix HPI polling timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Signed-off-by: Sujith Reddy Thumma <sthumma@xxxxxxxxxxxxxx>

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

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux