Commit 77347eda authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson

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 <yoshihiro.shimoda.uh@renesas.com>
Suggested-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Reviewed-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tested-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Fixes: bd11e8bd ("mmc: core: Flag re-tuning is needed on CRC errors")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210624151616.38770-2-wsa+renesas@sang-engineering.comSigned-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent c54b245d
...@@ -937,11 +937,14 @@ int mmc_execute_tuning(struct mmc_card *card) ...@@ -937,11 +937,14 @@ int mmc_execute_tuning(struct mmc_card *card)
err = host->ops->execute_tuning(host, opcode); err = host->ops->execute_tuning(host, opcode);
if (err) if (err) {
pr_err("%s: tuning execution failed: %d\n", pr_err("%s: tuning execution failed: %d\n",
mmc_hostname(host), err); mmc_hostname(host), err);
else } else {
host->retune_now = 0;
host->need_retune = 0;
mmc_retune_enable(host); mmc_retune_enable(host);
}
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment