mirror of
https://github.com/adulau/aha.git
synced 2024-12-29 04:06:22 +00:00
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: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
This commit is contained in:
parent
7b7bcefa35
commit
2687069f3a
2 changed files with 2 additions and 2 deletions
|
@ -302,7 +302,7 @@ int omap2_wait_clock_ready(void __iomem *reg, u32 mask, const char *name)
|
|||
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);
|
||||
else
|
||||
printk(KERN_ERR "Clock %s didn't enable in %d tries\n",
|
||||
|
|
|
@ -1099,7 +1099,7 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm)
|
|||
(c++ < PWRDM_TRANSITION_BAILOUT))
|
||||
udelay(1);
|
||||
|
||||
if (c >= PWRDM_TRANSITION_BAILOUT) {
|
||||
if (c > PWRDM_TRANSITION_BAILOUT) {
|
||||
printk(KERN_ERR "powerdomain: waited too long for "
|
||||
"powerdomain %s to complete transition\n", pwrdm->name);
|
||||
return -EAGAIN;
|
||||
|
|
Loading…
Reference in a new issue