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

Commit 646a8139 authored by Sahitya Tummala's avatar Sahitya Tummala
Browse files

mmc: sdhci-msm: Fix recursive tuning issue



For any commands, that are sent during tuning sequence
CRC errors are expected. But if SDHCI_NEEDS_RETUNING flag
is set, then it will recursively do the tuning and gets
stuck in tuning. Fix this by not allowing the re-tuning to
happen while it is already in tuning process.

Change-Id: I9cc39f03a01c34f2f5639d4c20776fd575c25231
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 82fbed04
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -966,6 +966,13 @@ int sdhci_msm_execute_tuning(struct sdhci_host *host, u32 opcode)
		(ios.timing == MMC_TIMING_UHS_SDR104)))
		return 0;

	/*
	 * Don't allow re-tuning for CRC errors observed for any commands
	 * that are sent during tuning sequence itself.
	 */
	if (msm_host->tuning_in_progress)
		return 0;
	msm_host->tuning_in_progress = true;
	pr_debug("%s: Enter %s\n", mmc_hostname(mmc), __func__);

	/* CDC/SDC4 DLL HW calibration is only required for HS400 mode*/
@@ -1142,6 +1149,7 @@ out:
	if (!rc)
		msm_host->tuning_done = true;
	spin_unlock_irqrestore(&host->lock, flags);
	msm_host->tuning_in_progress = false;
	pr_debug("%s: Exit %s, err(%d)\n", mmc_hostname(mmc), __func__, rc);
	return rc;
}
+1 −0
Original line number Diff line number Diff line
@@ -213,6 +213,7 @@ struct sdhci_msm_host {
	struct device_attribute pm_qos_group_status_attr;
	bool pm_qos_group_enable;
	struct sdhci_msm_pm_qos_irq pm_qos_irq;
	bool tuning_in_progress;
};

extern char *saved_command_line;