mmc: sdhci: Fix issue with SDHCI_NEEDS_RETUNING

The following two issues are addressed with this change -

1. The current code sets SDHCI_NEEDS_RETUNING flag even for tuning
commands and it will unecessarily cause tuning to be done again
for the next read/write command. Hence, we must not set this flag
for any CRC failures to tuning commands.

2. If SDHCI_NEEDS_RETUNING flag is set and if all tuning phases
pass, then the driver attempts to change the driver type by sending
CMD6 which is a not a tuning command. The driver will thus attempt
to do re-tuning again before sending CMD6 and goes forever in a
recursive loop. Hence, clear SDHCI_NEEDS_RETUNING flag before
executing tuning.

Change-Id: Iaf3b24b93fdf655392fe02c973799e465960a495
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
1 file changed