diff options
author | David Miller <davem@davemloft.net> | 2007-03-05 04:35:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-03-05 11:12:54 -0500 |
commit | 8690ba446defe2e2b81803756c099d2943dfd5fd (patch) | |
tree | c7df0f8765ffeeb192ae2a338427c4158100d77d /drivers/video | |
parent | 8f485612231792373580e8b2fe8ceb3791549aa5 (diff) |
[PATCH] video/aty/mach64_ct.c: fix bogus delay loop
CT based mach64 cards were reported to hang on sparc64 boxes when
compiled with gcc-4.1.x and later.
Looking at this piece of code, it's no surprise. A critical
delay was implemented as an empty for() loop, and gcc 4.0.x
and previous did not optimize it away, so we did get a delay.
But gcc-4.1.x and later can optimize it away, and we get crashes.
Use a real udelay() to fix this. Fix verified on SunBlade100.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/aty/mach64_ct.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/video/aty/mach64_ct.c b/drivers/video/aty/mach64_ct.c index f3b487b8710b..1fdcfdbf669b 100644 --- a/drivers/video/aty/mach64_ct.c +++ b/drivers/video/aty/mach64_ct.c | |||
@@ -598,7 +598,6 @@ static void aty_resume_pll_ct(const struct fb_info *info, | |||
598 | struct atyfb_par *par = info->par; | 598 | struct atyfb_par *par = info->par; |
599 | 599 | ||
600 | if (par->mclk_per != par->xclk_per) { | 600 | if (par->mclk_per != par->xclk_per) { |
601 | int i; | ||
602 | /* | 601 | /* |
603 | * This disables the sclk, crashes the computer as reported: | 602 | * This disables the sclk, crashes the computer as reported: |
604 | * aty_st_pll_ct(SPLL_CNTL2, 3, info); | 603 | * aty_st_pll_ct(SPLL_CNTL2, 3, info); |
@@ -614,7 +613,7 @@ static void aty_resume_pll_ct(const struct fb_info *info, | |||
614 | * helps for Rage Mobilities that sometimes crash when | 613 | * helps for Rage Mobilities that sometimes crash when |
615 | * we switch to sclk. (Daniel Mantione, 13-05-2003) | 614 | * we switch to sclk. (Daniel Mantione, 13-05-2003) |
616 | */ | 615 | */ |
617 | for (i=0;i<=0x1ffff;i++); | 616 | udelay(500); |
618 | } | 617 | } |
619 | 618 | ||
620 | aty_st_pll_ct(PLL_REF_DIV, pll->ct.pll_ref_div, par); | 619 | aty_st_pll_ct(PLL_REF_DIV, pll->ct.pll_ref_div, par); |