drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer.
commitfa63cf8d7fda913e5c473219ed4027ccf6d1d727
authorFrancisco Jerez <currojerez@riseup.net>
Tue, 21 Sep 2010 00:15:15 +0000 (21 02:15 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 21 Mar 2011 19:43:58 +0000 (21 12:43 -0700)
tree5f20749ed54e198b69ac913366c1abd56956edca
parente04e0db0e3c8fe2aafc618c1dd1bd1357e14be58
drm/ttm: Clear the ghost cpu_writers flag on ttm_buffer_object_transfer.

commit 0fbecd400dd0a82d465b3086f209681e8c54cb0f upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/gpu/drm/ttm/ttm_bo_util.c