kernel-fxtec-pro1x/drivers/gpu/drm/ttm
Luca Barbieri 1a961ce09f drm/ttm: Fix race condition in ttm_bo_delayed_delete (v3, final)
Resending this with Thomas Hellstrom's signoff for merging into 2.6.33

ttm_bo_delayed_delete has a race condition, because after we do:
kref_put(&nentry->list_kref, ttm_bo_release_list);

we are not holding the list lock and not holding any reference to
objects, and thus every bo in the list can be removed and freed at
this point.

However, we then use the next pointer we stored, which is not guaranteed
to be valid.

This was apparently the cause of some Nouveau oopses I experienced.

This patch rewrites the function so that it keeps the reference to nentry
until nentry itself is freed and we already got a reference to nentry->next.

v2 updated by me according to Thomas Hellstrom's feedback.
v3 proposed by Thomas Hellstrom. Commit comment updated by me.

Both updates fixed minor efficiency/style issues only and all three versions
should be correct.

Signed-off-by: Luca Barbieri <luca@luca-barbieri.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2010-01-25 11:43:54 +10:00
..
Makefile drm/ttm: Add TTM execbuf utilities. 2009-12-07 15:22:05 +10:00
ttm_agp_backend.c agp: switch AGP to use page array instead of unsigned long array 2009-06-19 10:21:42 +10:00
ttm_bo.c drm/ttm: Fix race condition in ttm_bo_delayed_delete (v3, final) 2010-01-25 11:43:54 +10:00
ttm_bo_util.c drm/ttm: Export symbols needed for the vmwgfx driver. 2009-12-07 15:22:07 +10:00
ttm_bo_vm.c drm/ttm: fix incorrect logic in ttm_bo_io path 2009-12-16 15:32:31 +10:00
ttm_execbuf_util.c drm/ttm: Add TTM execbuf utilities. 2009-12-07 15:22:05 +10:00
ttm_global.c drm/ttm: fix refcounting in ttm global code. 2009-10-06 15:46:10 +10:00
ttm_lock.c drm/ttm: Export symbols needed for vmwgfx suspend / resume operations. 2010-01-14 12:19:50 +10:00
ttm_memory.c drm/ttm: fix memory leak noticed by kmemleak. 2009-12-09 13:29:37 +10:00
ttm_module.c drm/ttm: Add a virtual ttm sysfs device. 2009-08-19 16:09:04 +10:00
ttm_object.c drm/ttm: Add user-space objects. 2009-12-07 15:22:01 +10:00
ttm_tt.c Merge branch 'drm-core-next' into drm-linus 2009-12-08 13:52:41 +10:00