提交 2bd8c475 编写于 作者: R Roel Kluin 提交者: Linus Torvalds

viafb: returns 0 two too early

Otherwise this will already return 0 if iteration MAXLOOP-2 occurs in the
first loop.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Cc: Joseph Chan <josephchan@via.com.tw>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 b83734ec
......@@ -267,13 +267,17 @@ int viafb_wait_engine_idle(void)
int loop = 0;
while (!(readl(viaparinfo->io_virt + VIA_REG_STATUS) &
VIA_VR_QUEUE_BUSY) && (loop++ < MAXLOOP))
VIA_VR_QUEUE_BUSY) && (loop < MAXLOOP)) {
loop++;
cpu_relax();
}
while ((readl(viaparinfo->io_virt + VIA_REG_STATUS) &
(VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY | VIA_3D_ENG_BUSY)) &&
(loop++ < MAXLOOP))
(loop < MAXLOOP)) {
loop++;
cpu_relax();
}
return loop >= MAXLOOP;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册