summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci-xenon-phy.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2018-12-10 10:56:26 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2018-12-17 08:26:24 +0100
commit0e6e7c2ff397e1bbebc882ca3132148aaaef1ddd (patch)
tree63666dc6b772877057e7f6be8013c7a77fb2331f /drivers/mmc/host/sdhci-xenon-phy.c
parent9f0ea0bda1d06120b053bb0c283f54afec59293d (diff)
mmc: sdhci-xenon: Fix timeout checks
Always check the wait condition before returning timeout. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Reviewed-by: Zhoujie Wu <zjwu@marvell.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-xenon-phy.c')
-rw-r--r--drivers/mmc/host/sdhci-xenon-phy.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c
index 5956e90380e8..5b5eb53a63d2 100644
--- a/drivers/mmc/host/sdhci-xenon-phy.c
+++ b/drivers/mmc/host/sdhci-xenon-phy.c
@@ -357,9 +357,13 @@ static int xenon_emmc_phy_enable_dll(struct sdhci_host *host)
/* Wait max 32 ms */
timeout = ktime_add_ms(ktime_get(), 32);
- while (!(sdhci_readw(host, XENON_SLOT_EXT_PRESENT_STATE) &
- XENON_DLL_LOCK_STATE)) {
- if (ktime_after(ktime_get(), timeout)) {
+ while (1) {
+ bool timedout = ktime_after(ktime_get(), timeout);
+
+ if (sdhci_readw(host, XENON_SLOT_EXT_PRESENT_STATE) &
+ XENON_DLL_LOCK_STATE)
+ break;
+ if (timedout) {
dev_err(mmc_dev(host->mmc), "Wait for DLL Lock time-out\n");
return -ETIMEDOUT;
}