]> git.hungrycats.org Git - linux/commitdiff
[AGPGART] Fix broken serverworks tlb flush routine.
authorDave Jones <davej@redhat.com>
Tue, 1 Jun 2004 09:50:18 +0000 (10:50 +0100)
committerDave Jones <davej@delerium.codemonkey.org.uk>
Tue, 1 Jun 2004 09:50:18 +0000 (10:50 +0100)
This is horribly broken due to a jiffy wrap bug, we never get out of
the while loop, preventing booting on a kernel with this driver
compiled in. (See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=124495)

The warning message there has never been reported in any bug report
that google can find, so I'm of the opinion that this driver is trying
to be too clever for its own good.  Rip out the jiffies logic completely,
it should be totally unnecessary.

drivers/char/agp/sworks-agp.c

index e08c241cd0c028a0bb4be9f6d02ada0f010a26aa..d3f3e80ff317dd3e8e1e9aac62f98c0f123e23c9 100644 (file)
@@ -248,26 +248,13 @@ static int serverworks_fetch_size(void)
  */
 static void serverworks_tlbflush(struct agp_memory *temp)
 {
-       unsigned long end;
-
-       OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 0x01);
-       end = jiffies + 3*HZ;
-       while(INREG8(serverworks_private.registers, 
-                    SVWRKS_POSTFLUSH) == 0x01) {
-               if((signed)(end - jiffies) <= 0) {
-                       printk(KERN_ERR PFX "Posted write buffer flush took more"
-                              "then 3 seconds\n");
-               }
-       }
-       OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 0x00000001);
-       end = jiffies + 3*HZ;
-       while(INREG32(serverworks_private.registers, 
-                    SVWRKS_DIRFLUSH) == 0x00000001) {
-               if((signed)(end - jiffies) <= 0) {
-                       printk(KERN_ERR PFX "TLB flush took more"
-                              "then 3 seconds\n");
-               }
-       }
+       OUTREG8(serverworks_private.registers, SVWRKS_POSTFLUSH, 1);
+       while(INREG8(serverworks_private.registers, SVWRKS_POSTFLUSH) == 1)
+               cpu_relax();
+
+       OUTREG32(serverworks_private.registers, SVWRKS_DIRFLUSH, 1);
+       while(INREG32(serverworks_private.registers, SVWRKS_DIRFLUSH) == 1)
+               cpu_relax();
 }
 
 static int serverworks_configure(void)