All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: fix ttm move notify callback
@ 2012-01-05 18:31 j.glisse
  2012-01-05 21:48 ` Konrad Rzeszutek Wilk
  2012-01-05 21:53 ` Ben Skeggs
  0 siblings, 2 replies; 13+ messages in thread
From: j.glisse @ 2012-01-05 18:31 UTC (permalink / raw)
  To: dri-devel; +Cc: Jerome Glisse

From: Jerome Glisse <jglisse@redhat.com>

ttm might call the move notify with null new mem placement,
properly handle this case inside nouveau move notify callback.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
---
 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,
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-05 18:31 [PATCH] drm/nouveau: fix ttm move notify callback j.glisse
@ 2012-01-05 21:48 ` Konrad Rzeszutek Wilk
  2012-01-05 21:51   ` Jerome Glisse
  2012-01-05 21:53 ` Ben Skeggs
  1 sibling, 1 reply; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-05 21:48 UTC (permalink / raw)
  To: j.glisse; +Cc: Jerome Glisse, dri-devel

On Thu, Jan 05, 2012 at 01:31:55PM -0500, j.glisse@gmail.com wrote:
> From: Jerome Glisse <jglisse@redhat.com>
> 
> ttm might call the move notify with null new mem placement,
> properly handle this case inside nouveau move notify callback.

Let me give this a spin tonight on both PCIe and AGP hardware.

Um, were you thinking to repost your TTM AGP patch? I remember you sent
it as a "hey, try this please", but can't recall whether you were looking
to post another one?

> 
> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
> ---
>  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,
> -- 
> 1.7.7.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-05 21:48 ` Konrad Rzeszutek Wilk
@ 2012-01-05 21:51   ` Jerome Glisse
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Glisse @ 2012-01-05 21:51 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Jerome Glisse, dri-devel

On Thu, Jan 5, 2012 at 4:48 PM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> On Thu, Jan 05, 2012 at 01:31:55PM -0500, j.glisse@gmail.com wrote:
>> From: Jerome Glisse <jglisse@redhat.com>
>>
>> ttm might call the move notify with null new mem placement,
>> properly handle this case inside nouveau move notify callback.
>
> Let me give this a spin tonight on both PCIe and AGP hardware.
>
> Um, were you thinking to repost your TTM AGP patch? I remember you sent
> it as a "hey, try this please", but can't recall whether you were looking
> to post another one?
>

AGP patch i sent is good to go. I tested it enough to be confident now.

Cheers,
Jerome

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-05 18:31 [PATCH] drm/nouveau: fix ttm move notify callback j.glisse
  2012-01-05 21:48 ` Konrad Rzeszutek Wilk
@ 2012-01-05 21:53 ` Ben Skeggs
       [not found]   ` <20120106021410.GA3120@phenom.dumpdata.com>
  1 sibling, 1 reply; 13+ messages in thread
From: Ben Skeggs @ 2012-01-05 21:53 UTC (permalink / raw)
  To: j.glisse; +Cc: Jerome Glisse, dri-devel

On Thu, 2012-01-05 at 13:31 -0500, j.glisse@gmail.com wrote:
> From: Jerome Glisse <jglisse@redhat.com>
> 
> 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.

Ben.
> 
> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
> ---
>  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,

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
       [not found]   ` <20120106021410.GA3120@phenom.dumpdata.com>
@ 2012-01-06 14:57     ` Konrad Rzeszutek Wilk
  2012-01-06 16:51       ` Jerome Glisse
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-06 14:57 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: Jerome Glisse, dri-devel

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 <jglisse@redhat.com>
> > > 
> > > 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 <jglisse@redhat.com>
> > > ---
> > >  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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-06 14:57     ` Konrad Rzeszutek Wilk
@ 2012-01-06 16:51       ` Jerome Glisse
  2012-01-06 16:53         ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 13+ messages in thread
From: Jerome Glisse @ 2012-01-06 16:51 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Jerome Glisse, dri-devel

On Fri, Jan 6, 2012 at 9:57 AM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> 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 <jglisse@redhat.com>
>> > >
>> > > 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
>

Anything special to trigger it ? I can't trigger it with simple gnome3
session (firefox evince ...)

Cheers,
Jerome

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-06 16:51       ` Jerome Glisse
@ 2012-01-06 16:53         ` Konrad Rzeszutek Wilk
  2012-01-06 18:22           ` Jerome Glisse
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-06 16:53 UTC (permalink / raw)
  To: Jerome Glisse; +Cc: Jerome Glisse, dri-devel

On Fri, Jan 06, 2012 at 11:51:03AM -0500, Jerome Glisse wrote:
> On Fri, Jan 6, 2012 at 9:57 AM, Konrad Rzeszutek Wilk
> <konrad.wilk@oracle.com> wrote:
> > 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 <jglisse@redhat.com>
> >> > >
> >> > > 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
> >
> 
> Anything special to trigger it ? I can't trigger it with simple gnome3
> session (firefox evince ...)

I ran etracer, then switched over to a framebuffer console (Alt-F2), logged in.
Then ran perf record and switched back to etracer. Ran a couple of laps and when finished
quit the perf top. On the PCI-e it took a while (so I had to run a couple of laps).

On the AGP one it happended immediately, which is no surprise since the code looks
to be activated when we do garbage collection and the machine only had 2GB. The
PCIe on has 8GB. Perhaps a better way would be to force the workqueue by setting the
pool limits to smaller values.

> 
> Cheers,
> Jerome

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-06 16:53         ` Konrad Rzeszutek Wilk
@ 2012-01-06 18:22           ` Jerome Glisse
  2012-01-06 19:52             ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 13+ messages in thread
From: Jerome Glisse @ 2012-01-06 18:22 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Jerome Glisse, dri-devel

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

On Fri, Jan 06, 2012 at 11:53:35AM -0500, Konrad Rzeszutek Wilk wrote:
> On Fri, Jan 06, 2012 at 11:51:03AM -0500, Jerome Glisse wrote:
> > On Fri, Jan 6, 2012 at 9:57 AM, Konrad Rzeszutek Wilk
> > <konrad.wilk@oracle.com> wrote:
> > > 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 <jglisse@redhat.com>
> > >> > >
> > >> > > 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
> > >
> > 
> > Anything special to trigger it ? I can't trigger it with simple gnome3
> > session (firefox evince ...)
> 
> I ran etracer, then switched over to a framebuffer console (Alt-F2), logged in.
> Then ran perf record and switched back to etracer. Ran a couple of laps and when finished
> quit the perf top. On the PCI-e it took a while (so I had to run a couple of laps).
> 
> On the AGP one it happended immediately, which is no surprise since the code looks
> to be activated when we do garbage collection and the machine only had 2GB. The
> PCIe on has 8GB. Perhaps a better way would be to force the workqueue by setting the
> pool limits to smaller values.
>

Still having difficulty to reproduce can you reproduce with the attached
printk debuging patch and provide the log (only few printk preceding the
oops or segfault are interesting).

Cheers,
Jerome

[-- Attachment #2: 0001-TTM-DEBUG-PRINTK.patch --]
[-- Type: text/plain, Size: 1215 bytes --]

>From 862e2cc6d35d85404ed24d24c5a5c49c5ef45fc7 Mon Sep 17 00:00:00 2001
From: Jerome Glisse <jglisse@redhat.com>
Date: Fri, 6 Jan 2012 13:20:08 -0500
Subject: [PATCH] TTM-DEBUG-PRINTK

---
 drivers/gpu/drm/nouveau/nouveau_bo.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 724b41a..326b64a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -812,12 +812,14 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem)
 	struct nouveau_bo *nvbo = nouveau_bo(bo);
 	struct nouveau_vma *vma;
 
+DRM_INFO("%s list (%p %p)\n", __func__, nvbo->vma_list.prev, nvbo->vma_list.next);
 	list_for_each_entry(vma, &nvbo->vma_list, head) {
 		if (new_mem && new_mem->mem_type == TTM_PL_VRAM) {
 			nouveau_vm_map(vma, new_mem->mm_node);
 		} else
 		if (new_mem && new_mem->mem_type == TTM_PL_TT &&
 		    nvbo->page_shift == vma->vm->spg_shift) {
+DRM_INFO("%s vma %p new mem %p %d pages\n", __func__, vma, new_mem, new_mem->num_pages);
 			nouveau_vm_map_sg(vma, 0, new_mem->
 					  num_pages << PAGE_SHIFT,
 					  new_mem->mm_node);
-- 
1.7.5.4


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-06 18:22           ` Jerome Glisse
@ 2012-01-06 19:52             ` Konrad Rzeszutek Wilk
  2012-01-06 21:00               ` Jerome Glisse
  0 siblings, 1 reply; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-06 19:52 UTC (permalink / raw)
  To: Jerome Glisse; +Cc: Jerome Glisse, dri-devel

> Still having difficulty to reproduce can you reproduce with the attached
> printk debuging patch and provide the log (only few printk preceding the
> oops or segfault are interesting).

http://darnok.org/vga/move_notify-v212.log

> 
> Cheers,
> Jerome

> >From 862e2cc6d35d85404ed24d24c5a5c49c5ef45fc7 Mon Sep 17 00:00:00 2001
> From: Jerome Glisse <jglisse@redhat.com>
> Date: Fri, 6 Jan 2012 13:20:08 -0500
> Subject: [PATCH] TTM-DEBUG-PRINTK
> 
> ---
>  drivers/gpu/drm/nouveau/nouveau_bo.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 724b41a..326b64a 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -812,12 +812,14 @@ nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, struct ttm_mem_reg *new_mem)
>  	struct nouveau_bo *nvbo = nouveau_bo(bo);
>  	struct nouveau_vma *vma;
>  
> +DRM_INFO("%s list (%p %p)\n", __func__, nvbo->vma_list.prev, nvbo->vma_list.next);
>  	list_for_each_entry(vma, &nvbo->vma_list, head) {
>  		if (new_mem && new_mem->mem_type == TTM_PL_VRAM) {
>  			nouveau_vm_map(vma, new_mem->mm_node);
>  		} else
>  		if (new_mem && new_mem->mem_type == TTM_PL_TT &&
>  		    nvbo->page_shift == vma->vm->spg_shift) {
> +DRM_INFO("%s vma %p new mem %p %d pages\n", __func__, vma, new_mem, new_mem->num_pages);
>  			nouveau_vm_map_sg(vma, 0, new_mem->
>  					  num_pages << PAGE_SHIFT,
>  					  new_mem->mm_node);
> -- 
> 1.7.5.4
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-06 19:52             ` Konrad Rzeszutek Wilk
@ 2012-01-06 21:00               ` Jerome Glisse
  2012-01-10  3:46                 ` Ben Skeggs
  0 siblings, 1 reply; 13+ messages in thread
From: Jerome Glisse @ 2012-01-06 21:00 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: Jerome Glisse, dri-devel

On Fri, Jan 06, 2012 at 02:52:49PM -0500, Konrad Rzeszutek Wilk wrote:
> > Still having difficulty to reproduce can you reproduce with the attached
> > printk debuging patch and provide the log (only few printk preceding the
> > oops or segfault are interesting).
> 
> http://darnok.org/vga/move_notify-v212.log
> 

Looks like nouveau doesn't like move notify being call on driver
shutdown or when somethings om nv50 is down. Ben i think you will
be better at finding a fix for that than me.

Cheers,
Jerome

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-06 21:00               ` Jerome Glisse
@ 2012-01-10  3:46                 ` Ben Skeggs
  2012-01-10 14:34                   ` Konrad Rzeszutek Wilk
  2012-01-24 15:00                   ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 13+ messages in thread
From: Ben Skeggs @ 2012-01-10  3:46 UTC (permalink / raw)
  To: Jerome Glisse; +Cc: Jerome Glisse, dri-devel

On Fri, 2012-01-06 at 16:00 -0500, Jerome Glisse wrote:
> On Fri, Jan 06, 2012 at 02:52:49PM -0500, Konrad Rzeszutek Wilk wrote:
> > > Still having difficulty to reproduce can you reproduce with the attached
> > > printk debuging patch and provide the log (only few printk preceding the
> > > oops or segfault are interesting).
> > 
> > http://darnok.org/vga/move_notify-v212.log
> > 
> 
> Looks like nouveau doesn't like move notify being call on driver
> shutdown or when somethings om nv50 is down. Ben i think you will
> be better at finding a fix for that than me.
I'm also not able to reproduce this issue on a NV98 (so, i'd expect
every nv50+ chipset to behave the same) chipset with the current code in
Dave's drm-core-next tree..

Am I missing something?

Ben.

> 
> Cheers,
> Jerome

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-10  3:46                 ` Ben Skeggs
@ 2012-01-10 14:34                   ` Konrad Rzeszutek Wilk
  2012-01-24 15:00                   ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-10 14:34 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: Jerome Glisse, dri-devel

On Tue, Jan 10, 2012 at 01:46:05PM +1000, Ben Skeggs wrote:
> On Fri, 2012-01-06 at 16:00 -0500, Jerome Glisse wrote:
> > On Fri, Jan 06, 2012 at 02:52:49PM -0500, Konrad Rzeszutek Wilk wrote:
> > > > Still having difficulty to reproduce can you reproduce with the attached
> > > > printk debuging patch and provide the log (only few printk preceding the
> > > > oops or segfault are interesting).
> > > 
> > > http://darnok.org/vga/move_notify-v212.log
> > > 
> > 
> > Looks like nouveau doesn't like move notify being call on driver
> > shutdown or when somethings om nv50 is down. Ben i think you will
> > be better at finding a fix for that than me.
> I'm also not able to reproduce this issue on a NV98 (so, i'd expect
> every nv50+ chipset to behave the same) chipset with the current code in
> Dave's drm-core-next tree..

I was using 3.2 and then merged drm-core-next tree on top of that.

> 
> Am I missing something?

I am using a stock Fedora 16 with X Server 1.11.2. Machine has 8GB,
and one DVI monitor and is an AMD box. The kernel was compiled
using the default Fedora Core .config and for any new options I just
hit enter.

Don't have the experimental libGL code, so using:
OpenGL version string: 2.1 Mesa 7.11.2

for the rendering. And the test setup is fairly easy - launch etracer,
switch to a FB VC (Ctrl-Alt-F2), login, find the etracer pid and run
perf --record --pid X and then switch back. Finish playing the game, exit
it and then switch to the FB VC to turn it off, and it happens.

Sometimes it happens when I just finished the game.

I also can reproduce this with an AGP card (GeForce 4 Ti4200?) on an
Intel Prescott box (2GB of memory) - also with stock Fedora 16.
Thought the crash is different:

http://darnok.org/vga/agp_nouveau_crash.jpg

Hmm, I can hook up a serial console to that box to get a better output - but
perhaps before I do that should is there a debug patch I should compile in?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] drm/nouveau: fix ttm move notify callback
  2012-01-10  3:46                 ` Ben Skeggs
  2012-01-10 14:34                   ` Konrad Rzeszutek Wilk
@ 2012-01-24 15:00                   ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 13+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-24 15:00 UTC (permalink / raw)
  To: Ben Skeggs; +Cc: Jerome Glisse, dri-devel

On Tue, Jan 10, 2012 at 01:46:05PM +1000, Ben Skeggs wrote:
> On Fri, 2012-01-06 at 16:00 -0500, Jerome Glisse wrote:
> > On Fri, Jan 06, 2012 at 02:52:49PM -0500, Konrad Rzeszutek Wilk wrote:
> > > > Still having difficulty to reproduce can you reproduce with the attached
> > > > printk debuging patch and provide the log (only few printk preceding the
> > > > oops or segfault are interesting).
> > > 
> > > http://darnok.org/vga/move_notify-v212.log
> > > 
> > 
> > Looks like nouveau doesn't like move notify being call on driver
> > shutdown or when somethings om nv50 is down. Ben i think you will
> > be better at finding a fix for that than me.
> I'm also not able to reproduce this issue on a NV98 (so, i'd expect
> every nv50+ chipset to behave the same) chipset with the current code in
> Dave's drm-core-next tree..

There looks to be a bug about this openned when folks where using firefox
and seeing large pictures or scrolling through a large web-page.

Any thoughts or things I could try out to narrow this down?

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-01-24 15:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-05 18:31 [PATCH] drm/nouveau: fix ttm move notify callback j.glisse
2012-01-05 21:48 ` Konrad Rzeszutek Wilk
2012-01-05 21:51   ` Jerome Glisse
2012-01-05 21:53 ` Ben Skeggs
     [not found]   ` <20120106021410.GA3120@phenom.dumpdata.com>
2012-01-06 14:57     ` Konrad Rzeszutek Wilk
2012-01-06 16:51       ` Jerome Glisse
2012-01-06 16:53         ` Konrad Rzeszutek Wilk
2012-01-06 18:22           ` Jerome Glisse
2012-01-06 19:52             ` Konrad Rzeszutek Wilk
2012-01-06 21:00               ` Jerome Glisse
2012-01-10  3:46                 ` Ben Skeggs
2012-01-10 14:34                   ` Konrad Rzeszutek Wilk
2012-01-24 15:00                   ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.