drm/ttm: Fix potential ttm_mem_evict_first races.
authorThomas Hellstrom <thellstrom@vmware.com>
Wed, 2 Dec 2009 17:33:46 +0000 (18:33 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 16 Dec 2009 05:34:40 +0000 (15:34 +1000)
commit9c51ba1db37cab780f38b2210913959f22d7b830
tree78136ca9c2fc00cd0550703fe07ae7ada55c11b9
parentaaa207369436d04bb85382ddbb688a5b9461fd21
drm/ttm: Fix potential ttm_mem_evict_first races.

1) The function was previously called with a potentially empty
LRU list which would have lead to an OOPS or servere corruption.
2) In rare cases, after reservation has succeeded, another process may
already have evicted it or even pinned it. We must revalidate the
buffer status after releasing the lru lock.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/ttm/ttm_bo.c