From: Andi Kleen Date: Sat, 5 Nov 2005 16:25:54 +0000 (+0100) Subject: [PATCH] AGP: Make gart iterator in K8 AGP driver SMP safe X-Git-Tag: v2.6.15-rc2~95^2~18 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d2e6bd86152ab86fb866555281869df340e6c6a;p=linux-2.6 [PATCH] AGP: Make gart iterator in K8 AGP driver SMP safe Ugh! Cc: davej@redhat.com Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index ec36c83338..49996c692a 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -58,7 +58,6 @@ static struct pci_dev * hammers[MAX_HAMMER_GARTS]; static struct resource *aperture_resource; static int __initdata agp_try_unsupported = 1; -static int gart_iterator; #define for_each_nb() for(gart_iterator=0;gart_iteratorgatt_table_real); + int gart_iterator; /* Configure AGP regs in each x86-64 host bridge. */ for_each_nb() { @@ -234,7 +235,7 @@ static int amd_8151_configure(void) static void amd64_cleanup(void) { u32 tmp; - + int gart_iterator; for_each_nb() { /* disable gart translation */ pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp);