Skip to contentSkip to conversation

FAILED: patch "[PATCH] mmc: core: clear flags before allowing to retune" failed to apply to 4.4-stable tree

PATCH [email protected] 1 participant 1 message Jul 15, 2021

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.4-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 77347eda64ed5c9383961d1de9165f9d0b7d8df6 Mon Sep 17 00:00:00 2001
From: Wolfram Sang <[email protected]>
Date: Thu, 24 Jun 2021 17:16:14 +0200
Subject: [PATCH] mmc: core: clear flags before allowing to retune

It might be that something goes wrong during tuning so the MMC core will immediately trigger a retune. In our case it was:

- we sent a tuning block
- there was an error so we need to send an abort cmd to the eMMC
- the abort cmd had a CRC error
- retune was set by the MMC core

This lead to a vicious circle causing a performance regression of 75%. So, clear retuning flags before we enable retuning to start with a known cleared state.

Reported-by Yoshihiro Shimoda <[email protected]>

drivers/mmc/core/core.c +5 -2
index b039dcff17f8..95fedcf56e4a 100644
@@ -937,11 +937,14 @@ int mmc_execute_tuning(struct mmc_card *card)
 
 	err = host->ops->execute_tuning(host, opcode);
 
-	if (err)
+	if (err) {
 		pr_err("%s: tuning execution failed: %d\n",
 			mmc_hostname(host), err);
-	else
+	} else {
+		host->retune_now = 0;
+		host->need_retune = 0;
 		mmc_retune_enable(host);
+	}
 
 	return err;
 }