]>
Commit | Line | Data |
---|---|---|
ea66788a GKH |
1 | From 0fbecd400dd0a82d465b3086f209681e8c54cb0f Mon Sep 17 00:00:00 2001 |
2 | From: Francisco Jerez <currojerez@riseup.net> | |
3 | Date: Tue, 21 Sep 2010 02:15:15 +0200 | |
4 | Subject: drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer. | |
5 | ||
6 | From: Francisco Jerez <currojerez@riseup.net> | |
7 | ||
8 | commit 0fbecd400dd0a82d465b3086f209681e8c54cb0f upstream. | |
9 | ||
10 | It makes sense for a BO to move after a process has requested | |
11 | exclusive RW access on it (e.g. because the BO used to be located in | |
12 | unmappable VRAM and we intercepted the CPU access from the fault | |
13 | handler). | |
14 | ||
15 | If we let the ghost object inherit cpu_writers from the original | |
16 | object, ttm_bo_release_list() will raise a kernel BUG when the ghost | |
17 | object is destroyed. This can be reproduced with the nouveau driver on | |
18 | nv5x. | |
19 | ||
20 | Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com> | |
21 | Reviewed-by: Jerome Glisse <jglisse@redhat.com> | |
22 | Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com> | |
23 | Signed-off-by: Francisco Jerez <currojerez@riseup.net> | |
24 | Signed-off-by: Dave Airlie <airlied@redhat.com> | |
25 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
26 | ||
27 | --- | |
28 | drivers/gpu/drm/ttm/ttm_bo_util.c | 1 + | |
29 | 1 file changed, 1 insertion(+) | |
30 | ||
31 | --- a/drivers/gpu/drm/ttm/ttm_bo_util.c | |
32 | +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |
33 | @@ -330,6 +330,7 @@ static int ttm_buffer_object_transfer(st | |
34 | INIT_LIST_HEAD(&fbo->lru); | |
35 | INIT_LIST_HEAD(&fbo->swap); | |
36 | fbo->vm_node = NULL; | |
37 | + atomic_set(&fbo->cpu_writers, 0); | |
38 | ||
39 | fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj); | |
40 | if (fbo->mem.mm_node) |