From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] drm/nouveau: fix ttm move notify callback Date: Fri, 6 Jan 2012 09:57:43 -0500 Message-ID: <20120106145743.GE5078@phenom.dumpdata.com> References: <1325788315-7724-1-git-send-email-j.glisse@gmail.com> <1325800393.31799.0.camel@nisroch> <20120106021410.GA3120@phenom.dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by gabe.freedesktop.org (Postfix) with ESMTP id E41CF9E969 for ; Fri, 6 Jan 2012 07:43:48 -0800 (PST) Content-Disposition: inline In-Reply-To: <20120106021410.GA3120@phenom.dumpdata.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Ben Skeggs Cc: Jerome Glisse , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Thu, Jan 05, 2012 at 09:14:10PM -0500, Konrad Rzeszutek Wilk wrote: > On Fri, Jan 06, 2012 at 07:53:13AM +1000, Ben Skeggs wrote: > > On Thu, 2012-01-05 at 13:31 -0500, j.glisse@gmail.com wrote: > > > From: Jerome Glisse > > > > > > ttm might call the move notify with null new mem placement, > > > properly handle this case inside nouveau move notify callback. > > This has been fixed already in a -next tree I sent to Dave. > > I just tried -next with your patch (and two other fixes that I had sent): > > drm/ttm/dma: Only call set_pages_array_wb when the page is not in WB pool > drm/ttm/dma: Fix accounting error when calling ttm_mem_global_free_page and don't try to free freed pages > > and Jerome's AGP fix: > ttm: fix agp since ttm tt rework > > and got the crash (but only with NVidia cards) after swapping between Xorg and the VCs. > Look in drm-next.jpg http://darnok.org/vga/drm-next.jpg > > With your patch removed ("drm/nouveau/ttm: fix crash as a result of a recent ttm change") > and the patch below by Jerome I still get it to crash (see drm-next-with-Jerome-fix-revert-Ben.jpg).. http://darnok.org/vga/drm-next-with-Jerome-fix-revert-Ben.jpg > > > > > Ben. > > > > > > Signed-off-by: Jerome Glisse > > > --- > > > drivers/gpu/drm/nouveau/nouveau_bo.c | 6 +++--- > > > 1 files changed, 3 insertions(+), 3 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c > > > index f12dd0f..65f5b0b 100644 > > > --- a/drivers/gpu/drm/nouveau/nouveau_bo.c > > > +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c > > > @@ -808,9 +808,8 @@ out: > > > } > > > > > > static void > > > -nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) > > > +nouveau_bo_move_notify(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) > > > { > > > - struct nouveau_mem *node = new_mem->mm_node; > > > struct nouveau_bo *nvbo = nouveau_bo(bo); > > > struct nouveau_vma *vma; > > > > > > @@ -820,6 +819,7 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem) > > > } else > > > if (new_mem && new_mem->mem_type == TTM_PL_TT && > > > nvbo->page_shift == vma->vm->spg_shift) { > > > + struct nouveau_mem *node = new_mem->mm_node; > > > nouveau_vm_map_sg(vma, 0, new_mem-> > > > num_pages << PAGE_SHIFT, > > > node, node->pages); > > > @@ -1131,7 +1131,7 @@ struct ttm_bo_driver nouveau_bo_driver = { > > > .invalidate_caches = nouveau_bo_invalidate_caches, > > > .init_mem_type = nouveau_bo_init_mem_type, > > > .evict_flags = nouveau_bo_evict_flags, > > > - .move_notify = nouveau_bo_move_ntfy, > > > + .move_notify = nouveau_bo_move_notify, > > > .move = nouveau_bo_move, > > > .verify_access = nouveau_bo_verify_access, > > > .sync_obj_signaled = __nouveau_fence_signalled, > > > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > http://lists.freedesktop.org/mailman/listinfo/dri-devel