summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-03-31 15:25:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 08:59:32 -0700
commit2bd8c47597b2522795f5eb2e61c22dcfec5dfa6a (patch)
tree37d6d0617059f42680ec2dc458da2841856064dc /drivers/video
parentb83734ec0975e1f53420b7a2d454612fc905a9d0 (diff)
downloadlinux-2bd8c47597b2522795f5eb2e61c22dcfec5dfa6a.tar.bz2
viafb: returns 0 two too early
Otherwise this will already return 0 if iteration MAXLOOP-2 occurs in the first loop. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: Joseph Chan <josephchan@via.com.tw> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/via/accel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/via/accel.c b/drivers/video/via/accel.c
index 632523ff1fb7..45c54bfe99bb 100644
--- a/drivers/video/via/accel.c
+++ b/drivers/video/via/accel.c
@@ -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;
}