diff options
author | Andi Kleen <ak@suse.de> | 2005-11-05 11:25:54 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-14 22:55:16 -0500 |
commit | 1d2e6bd86152ab86fb866555281869df340e6c6a (patch) | |
tree | abdaeb1737b4ba6562af6482b435c7f3afcdc0f4 /drivers/char/agp/amd64-agp.c | |
parent | 172efbb40333d0ca10ebaab11a98f9be687bee39 (diff) |
[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>
Diffstat (limited to 'drivers/char/agp/amd64-agp.c')
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index ec36c833387b..49996c692a73 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]; | |||
58 | static struct resource *aperture_resource; | 58 | static struct resource *aperture_resource; |
59 | static int __initdata agp_try_unsupported = 1; | 59 | static int __initdata agp_try_unsupported = 1; |
60 | 60 | ||
61 | static int gart_iterator; | ||
62 | #define for_each_nb() for(gart_iterator=0;gart_iterator<nr_garts;gart_iterator++) | 61 | #define for_each_nb() for(gart_iterator=0;gart_iterator<nr_garts;gart_iterator++) |
63 | 62 | ||
64 | static void flush_amd64_tlb(struct pci_dev *dev) | 63 | static void flush_amd64_tlb(struct pci_dev *dev) |
@@ -72,6 +71,7 @@ static void flush_amd64_tlb(struct pci_dev *dev) | |||
72 | 71 | ||
73 | static void amd64_tlbflush(struct agp_memory *temp) | 72 | static void amd64_tlbflush(struct agp_memory *temp) |
74 | { | 73 | { |
74 | int gart_iterator; | ||
75 | for_each_nb() | 75 | for_each_nb() |
76 | flush_amd64_tlb(hammers[gart_iterator]); | 76 | flush_amd64_tlb(hammers[gart_iterator]); |
77 | } | 77 | } |
@@ -221,6 +221,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] = | |||
221 | static int amd_8151_configure(void) | 221 | static int amd_8151_configure(void) |
222 | { | 222 | { |
223 | unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real); | 223 | unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real); |
224 | int gart_iterator; | ||
224 | 225 | ||
225 | /* Configure AGP regs in each x86-64 host bridge. */ | 226 | /* Configure AGP regs in each x86-64 host bridge. */ |
226 | for_each_nb() { | 227 | for_each_nb() { |
@@ -234,7 +235,7 @@ static int amd_8151_configure(void) | |||
234 | static void amd64_cleanup(void) | 235 | static void amd64_cleanup(void) |
235 | { | 236 | { |
236 | u32 tmp; | 237 | u32 tmp; |
237 | 238 | int gart_iterator; | |
238 | for_each_nb() { | 239 | for_each_nb() { |
239 | /* disable gart translation */ | 240 | /* disable gart translation */ |
240 | pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp); | 241 | pci_read_config_dword (hammers[gart_iterator], AMD64_GARTAPERTURECTL, &tmp); |