Commit 2687069f authored by Roel Kluin's avatar Roel Kluin Committed by paul

OMAP2 clock/powerdomain: off by 1 error in loop timeout comparisons

with while (i++ < MAX_CLOCK_ENABLE_WAIT); i can reach MAX_CLOCK_ENABLE_WAIT + 1
after the loop, so if (i == MAX_CLOCK_ENABLE_WAIT) that's still success.
Signed-off-by: default avatarRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent 7b7bcefa
...@@ -302,7 +302,7 @@ int omap2_wait_clock_ready(void __iomem *reg, u32 mask, const char *name) ...@@ -302,7 +302,7 @@ int omap2_wait_clock_ready(void __iomem *reg, u32 mask, const char *name)
udelay(1); udelay(1);
} }
if (i < MAX_CLOCK_ENABLE_WAIT) if (i <= MAX_CLOCK_ENABLE_WAIT)
pr_debug("Clock %s stable after %d loops\n", name, i); pr_debug("Clock %s stable after %d loops\n", name, i);
else else
printk(KERN_ERR "Clock %s didn't enable in %d tries\n", printk(KERN_ERR "Clock %s didn't enable in %d tries\n",
......
...@@ -1099,7 +1099,7 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm) ...@@ -1099,7 +1099,7 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm)
(c++ < PWRDM_TRANSITION_BAILOUT)) (c++ < PWRDM_TRANSITION_BAILOUT))
udelay(1); udelay(1);
if (c >= PWRDM_TRANSITION_BAILOUT) { if (c > PWRDM_TRANSITION_BAILOUT) {
printk(KERN_ERR "powerdomain: waited too long for " printk(KERN_ERR "powerdomain: waited too long for "
"powerdomain %s to complete transition\n", pwrdm->name); "powerdomain %s to complete transition\n", pwrdm->name);
return -EAGAIN; return -EAGAIN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment