diff options
author | Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> | 2022-02-23 15:13:30 +0100 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2022-03-07 08:55:14 +0100 |
commit | c252b2774782360fd8785230072bb6c262a06709 (patch) | |
tree | b06418ab131e0ac73ba70d89c5f519f91b77712e | |
parent | 03a8e826e0a05e7d255074d2c1a53feb84ca6b26 (diff) | |
download | u-boot-c252b2774782360fd8785230072bb6c262a06709.tar.gz |
mmc: zynq_sdhci: Fix timeout issue
In the workaround added with 'commit b6f44082d5cd ("mmc: zynq_sdhci: Wait
till sd card detect state is stable")' the timeout variable has post
decrement. Whenever timeout happens, this post decrement is making
timeout=0xffffffff, so timeout error print and return statement are
never reached. Fix it by decrementing it inside the while loop.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/61fc1160ada0dd622cd29e381a74af7bf3d9a200.1645625609.git.michal.simek@xilinx.com
-rw-r--r-- | drivers/mmc/zynq_sdhci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index 5cea4c695e8..f4d69a2f709 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -773,8 +773,9 @@ static int arasan_sdhci_probe(struct udevice *dev) u32 timeout = 1000; while (((sdhci_readl(host, SDHCI_PRESENT_STATE) & - SDHCI_CARD_STATE_STABLE) == 0) && timeout--) { + SDHCI_CARD_STATE_STABLE) == 0) && timeout) { mdelay(1); + timeout--; } if (!timeout) { dev_err(dev, "Sdhci card detect state not stable\n"); |