diff options
author | Dave Airlie <airlied@redhat.com> | 2007-10-14 20:19:16 -0400 |
---|---|---|
committer | Dave Airlie <airlied@optimus.(none)> | 2007-10-14 20:32:15 -0400 |
commit | a2721e998ede079db10f65e4b42310f79dc8f135 (patch) | |
tree | 32963c9bf40f3e0871d4d549bb6c3cf13abbb24c /drivers/char/agp/i460-agp.c | |
parent | 23fd50450a34f2558070ceabb0bfebc1c9604af5 (diff) |
AGP fix race condition between unmapping and freeing pages
With Andi's clflush fixup, we were getting hangs on server exit, flushing the
mappings after freeing each page helped.
This showed up a race condition where the pages after being freed could be
reused before the agp mappings had been flushed. Flushing after each single
page is a bad thing for future drm work, so make the page destroy a two pass
unmapping all the pages, flushing the mappings, and then destroying the pages.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'drivers/char/agp/i460-agp.c')
-rw-r--r-- | drivers/char/agp/i460-agp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index 75d2aca6353d..70117df4d067 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -536,10 +536,10 @@ static void *i460_alloc_page (struct agp_bridge_data *bridge) | |||
536 | return page; | 536 | return page; |
537 | } | 537 | } |
538 | 538 | ||
539 | static void i460_destroy_page (void *page) | 539 | static void i460_destroy_page (void *page, int flags) |
540 | { | 540 | { |
541 | if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) { | 541 | if (I460_IO_PAGE_SHIFT <= PAGE_SHIFT) { |
542 | agp_generic_destroy_page(page); | 542 | agp_generic_destroy_page(page, flags); |
543 | global_flush_tlb(); | 543 | global_flush_tlb(); |
544 | } | 544 | } |
545 | } | 545 | } |