OSDN Git Service

mmc: sdhci-omap: Fix Tuning procedure for temperatures < -20C
authorFaiz Abbas <faiz_abbas@ti.com>
Thu, 10 Oct 2019 10:52:30 +0000 (16:22 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Mar 2020 10:55:57 +0000 (11:55 +0100)
commit6bdf6513f33087fb2280c8c40439f362e7ee6fdc
treeb11e613090ec54787ab8a7b01aa961e2d35dc9d1
parent3f909e15839c1c9edaa02d061f1198fb24de32ff
mmc: sdhci-omap: Fix Tuning procedure for temperatures < -20C

[ Upstream commit feb40824d78eac5e48f56498dca941754dff33d7 ]

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: 961de0a856e3 ("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: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/sdhci-omap.c