[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#591061: errata



Cyril Brulebois <kibi@debian.org> (27/09/2010):
> According to <https://bugzilla.redhat.com/show_bug.cgi?id=615505#c39>,
> Dave Airlie seems to be close to finding the underlying issue.

Patch available:
  http://git.kernel.org/?p=linux/kernel/git/airlied/drm-2.6.git;a=commitdiff_plain;h=0fbecd400dd0a82d465b3086f209681e8c54cb0f

I'm attaching it for your convenience.

Mraw,
KiBi.
From: Francisco Jerez <currojerez@riseup.net>
Date: Tue, 21 Sep 2010 00:15:15 +0000 (+0200)
Subject: drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer.
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fairlied%2Fdrm-2.6.git;a=commitdiff_plain;h=0fbecd400dd0a82d465b3086f209681e8c54cb0f

drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer.

It makes sense for a BO to move after a process has requested
exclusive RW access on it (e.g. because the BO used to be located in
unmappable VRAM and we intercepted the CPU access from the fault
handler).

If we let the ghost object inherit cpu_writers from the original
object, ttm_bo_release_list() will raise a kernel BUG when the ghost
object is destroyed. This can be reproduced with the nouveau driver on
nv5x.

Reported-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Tested-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
---

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 7cffb3e..3451a82 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -351,6 +351,7 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
 	INIT_LIST_HEAD(&fbo->lru);
 	INIT_LIST_HEAD(&fbo->swap);
 	fbo->vm_node = NULL;
+	atomic_set(&fbo->cpu_writers, 0);
 
 	fbo->sync_obj = driver->sync_obj_ref(bo->sync_obj);
 	kref_init(&fbo->list_kref);

Attachment: signature.asc
Description: Digital signature


Reply to: