Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac28baee authored by Konstantin Dorfman's avatar Konstantin Dorfman
Browse files

mmc: core: use cache flush timeout as cache disable timeout



When eMMC cache is disabled, the card has to flush all the data in its
cache.
This change increases the timeout for cache flush operation and also uses
the cache flush timeout in cache disable operation.

Change-Id: I373050a99816c95e784a957de4271955a511b9f9
CRs-Fixed: 723701
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent 3511ae2a
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -59,8 +59,7 @@ static void mmc_clk_scaling(struct mmc_host *host, bool from_wq);
#define MMC_BKOPS_MAX_TIMEOUT	(30 * 1000) /* max time to wait in ms */

/* Flushing a large amount of cached data may take a long time. */
#define MMC_FLUSH_REQ_TIMEOUT_MS 90000 /* msec */
#define MMC_CACHE_DISBALE_TIMEOUT_MS 180000 /* msec */
#define MMC_FLUSH_REQ_TIMEOUT_MS 180000 /* msec */

static struct workqueue_struct *workqueue;
static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
@@ -3632,7 +3631,7 @@ int mmc_cache_ctrl(struct mmc_host *host, u8 enable)

		if (card->ext_csd.cache_ctrl ^ enable) {
			if (!enable)
				timeout = MMC_CACHE_DISBALE_TIMEOUT_MS;
				timeout = MMC_FLUSH_REQ_TIMEOUT_MS;

			err = mmc_switch_ignore_timeout(card,
					EXT_CSD_CMD_SET_NORMAL,