Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] AGP: Make gart iterator in K8 AGP driver SMP safe

Ugh!

Cc: davej@redhat.com
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Andi Kleen and committed by
Linus Torvalds
1d2e6bd8 172efbb4

+3 -2
+3 -2
drivers/char/agp/amd64-agp.c
··· 58 58 static struct resource *aperture_resource; 59 59 static int __initdata agp_try_unsupported = 1; 60 60 61 - static int gart_iterator; 62 61 #define for_each_nb() for(gart_iterator=0;gart_iterator<nr_garts;gart_iterator++) 63 62 64 63 static void flush_amd64_tlb(struct pci_dev *dev) ··· 71 72 72 73 static void amd64_tlbflush(struct agp_memory *temp) 73 74 { 75 + int gart_iterator; 74 76 for_each_nb() 75 77 flush_amd64_tlb(hammers[gart_iterator]); 76 78 } ··· 221 221 static int amd_8151_configure(void) 222 222 { 223 223 unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real); 224 + int gart_iterator; 224 225 225 226 /* Configure AGP regs in each x86-64 host bridge. */ 226 227 for_each_nb() { ··· 235 234 static void amd64_cleanup(void) 236 235 { 237 236 u32 tmp; 238 - 237 + int gart_iterator; 239 238 for_each_nb() { 240 239 /* disable gart translation */ 241 240 pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp);