[PATCH] x86_64: Use cpu_relax in poll loop in GART IOMMU
authorAndi Kleen <ak@suse.de>
Sat, 25 Mar 2006 15:29:37 +0000 (16:29 +0100)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sat, 25 Mar 2006 17:10:53 +0000 (09:10 -0800)
The code waits for the GART to clear the TLB flush bit. Use cpu_relax
in this time to allow hypervisors to yield the CPU in this time.

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/x86_64/kernel/pci-gart.c

index 0c3f052ba6cebb8af7a6c79ca961611288be6727..ebd125e968bed8657ca093e8b5cdee97cdb9a361 100644 (file)
@@ -148,9 +148,12 @@ static void flush_gart(struct device *dev)
                        if (!northbridges[i])
                                continue;
                        /* Make sure the hardware actually executed the flush. */
-                       do { 
+                       for (;;) { 
                                pci_read_config_dword(northbridges[i], 0x9c, &w);
-                       } while (w & 1);
+                               if (!(w & 1))
+                                       break;
+                               cpu_relax();
+                       }
                } 
                if (!flushed) 
                        printk("nothing to flush?\n");