mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08: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
@ -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)
|
|||||||
(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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user