Skip to content

Commit a9262db

Browse files
Faiz-Abbassmb49
authored andcommitted
mmc: sdhci-omap: Fix Tuning procedure for temperatures < -20C
BugLink: https://bugs.launchpad.net/bugs/1850456 commit feb4082 upstream. According to the App note[1] detailing the tuning algorithm, for temperatures < -20C, the initial tuning value should be min(largest value in LPW - 24, ceil(13/16 ratio of LPW)). The largest value in LPW is (max_window + 4 * (max_len - 1)) and not (max_window + 4 * max_len) itself. Fix this implementation. [1] http://www.ti.com/lit/an/spraca9b/spraca9b.pdf Fixes: 961de0a ("mmc: sdhci-omap: Workaround errata regarding SDR104/HS200 tuning failures (i929)") Cc: stable@vger.kernel.org Signed-off-by: Faiz Abbas <faiz_abbas@ti.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Connor Kuehl <connor.kuehl@canonical.com> Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
1 parent 1d470f2 commit a9262db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/host/sdhci-omap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static int sdhci_omap_execute_tuning(struct mmc_host *mmc, u32 opcode)
372372
* on temperature
373373
*/
374374
if (temperature < -20000)
375-
phase_delay = min(max_window + 4 * max_len - 24,
375+
phase_delay = min(max_window + 4 * (max_len - 1) - 24,
376376
max_window +
377377
DIV_ROUND_UP(13 * max_len, 16) * 4);
378378
else if (temperature < 20000)

0 commit comments

Comments
 (0)