mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
mmc: zynq_sdhci: Fix timeout issue
In the workaround added with 'commit b6f44082d5
("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
This commit is contained in:
parent
03a8e826e0
commit
c252b27747
1 changed files with 2 additions and 1 deletions
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue